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) => {
if (headers[header])
headers[header] = encodeUrl(headers[header]?.toString() as string, origin);
headers[header] = encodeUrl(
headers[header]?.toString() as string,
origin
);
});
if (headers["link"]) {

View file

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