This commit is contained in:
Percs 2024-07-19 16:44:56 -05:00
parent fa1431840a
commit 2c415265ea
2 changed files with 5 additions and 4 deletions

View file

@ -37,7 +37,10 @@ export function rewriteHeaders(rawHeaders: BareHeaders, origin?: URL) {
urlHeaders.forEach((header) => { urlHeaders.forEach((header) => {
if (headers[header]) if (headers[header])
headers[header] = encodeUrl(headers[header]?.toString() as string, origin); headers[header] = encodeUrl(
headers[header]?.toString() as string,
origin
);
}); });
if (headers["link"]) { if (headers["link"]) {

View file

@ -73,9 +73,7 @@ async function handleResponse(
switch (destination) { switch (destination) {
case "iframe": case "iframe":
case "document": case "document":
if ( if (responseHeaders["content-type"]?.startsWith("text/html")) {
responseHeaders["content-type"]?.startsWith("text/html")
) {
responseBody = rewriteHtml(await response.text(), url); responseBody = rewriteHtml(await response.text(), url);
} else { } else {
responseBody = response.body; responseBody = response.body;