mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
prettier
This commit is contained in:
parent
fa1431840a
commit
2c415265ea
2 changed files with 5 additions and 4 deletions
|
@ -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"]) {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue