diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-proxy/proxy.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-proxy/proxy.js index c3028d4f..8d2cb4ef 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-proxy/proxy.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-proxy/proxy.js @@ -56,7 +56,7 @@ wtv-expire-all: wtv-proxy:/`; sendToClient(socket, headers, data); } else { if (request_headers.query.err) { - finishPage(`

Error

${request_headers.query.err}

`).join('
'); + finishPage(`

Error

${request_headers.query.err}

`); } else { if (request_headers.query.Fn) { if (typeof request_headers.query.Fn !== 'string') { @@ -80,7 +80,7 @@ wtv-expire-all: wtv-proxy:/`; if (params.get('Fn') === 'Home') { headers = `302 Moved -Location: /proxy` +Location: wtv-proxy:/proxy` data = ''; sendToClient(socket, headers, data); } else { @@ -136,7 +136,13 @@ function process(content) { img: imgSrcMatch[1] }); } - finishPage(links.map(link => ``).join('
')); + // Extract the current URL + const urlInputMatch = content.match(/]+type=["']text["'][^>]+name=["']url["'][^>]+value=["']([^"']+)["']/i); + let pageUrl = request_headers.query.url || ''; + if (urlInputMatch) { + pageUrl = urlInputMatch[1]; + } + finishPage(links.map(link => ``).join('
'), pageUrl); // You can now use the `links` array as needed } else { @@ -146,7 +152,7 @@ function process(content) { } } -function finishPage(content) { +function finishPage(content, url) { headers = `200 OK Content-Type: text/html wtv-expire-all: wtv-proxy:/`; @@ -159,7 +165,7 @@ wtv-expire-all: wtv-proxy:/`;
- +