mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
update libcurl transport and fix header rewriting issue
This commit is contained in:
parent
9305bf7ce3
commit
fa1431840a
3 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@
|
||||||
"@fastify/static": "^7.0.3",
|
"@fastify/static": "^7.0.3",
|
||||||
"@mercuryworkshop/bare-as-module3": "^2.2.2",
|
"@mercuryworkshop/bare-as-module3": "^2.2.2",
|
||||||
"@mercuryworkshop/epoxy-transport": "^2.1.3",
|
"@mercuryworkshop/epoxy-transport": "^2.1.3",
|
||||||
"@mercuryworkshop/libcurl-transport": "^1.3.6",
|
"@mercuryworkshop/libcurl-transport": "^1.3.7",
|
||||||
"@rsdoctor/rspack-plugin": "^0.3.7",
|
"@rsdoctor/rspack-plugin": "^0.3.7",
|
||||||
"@rspack/cli": "^0.7.5",
|
"@rspack/cli": "^0.7.5",
|
||||||
"@rspack/core": "^0.7.5",
|
"@rspack/core": "^0.7.5",
|
||||||
|
|
|
@ -37,7 +37,7 @@ export function rewriteHeaders(rawHeaders: BareHeaders, origin?: URL) {
|
||||||
|
|
||||||
urlHeaders.forEach((header) => {
|
urlHeaders.forEach((header) => {
|
||||||
if (headers[header])
|
if (headers[header])
|
||||||
headers[header] = encodeUrl(headers[header] as string, origin);
|
headers[header] = encodeUrl(headers[header]?.toString() as string, origin);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (headers["link"]) {
|
if (headers["link"]) {
|
||||||
|
|
|
@ -74,7 +74,7 @@ async function handleResponse(
|
||||||
case "iframe":
|
case "iframe":
|
||||||
case "document":
|
case "document":
|
||||||
if (
|
if (
|
||||||
responseHeaders["content-type"]?.toString()?.startsWith("text/html")
|
responseHeaders["content-type"]?.startsWith("text/html")
|
||||||
) {
|
) {
|
||||||
responseBody = rewriteHtml(await response.text(), url);
|
responseBody = rewriteHtml(await response.text(), url);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue