fix: LND UI use protocol-aware fetch, default backend URL
- fetchConnectInfo: use window.location.protocol instead of hardcoded http:// - getBackendUrl: default to current origin when no ?backend= param - Fixes mixed content errors on HTTPS Tailscale servers - Also fixed: nginx needed reload on Tailscale servers, Arch 2 missing /lnd-connect-info nginx location Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ec916892de
commit
2339946e6a
@ -434,7 +434,7 @@
|
||||
|
||||
function getBackendUrl() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
return params.get('backend') || '';
|
||||
return params.get('backend') || (window.location.protocol + '//' + window.location.hostname);
|
||||
}
|
||||
|
||||
function setSettingsTab(tabId) {
|
||||
@ -629,7 +629,7 @@
|
||||
|
||||
async function fetchConnectInfo() {
|
||||
try {
|
||||
const resp = await fetch('http://' + window.location.hostname + '/lnd-connect-info');
|
||||
const resp = await fetch(window.location.protocol + '//' + window.location.hostname + '/lnd-connect-info');
|
||||
if (!resp.ok) throw new Error('HTTP ' + resp.status);
|
||||
const data = await resp.json();
|
||||
if (data.cert_base64url) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user