mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
fix the rebase
This commit is contained in:
parent
51abf6577f
commit
0414819252
1 changed files with 3 additions and 2 deletions
|
@ -24,7 +24,8 @@ self.ScramjetServiceWorker = class ScramjetServiceWorker {
|
||||||
|
|
||||||
async fetch({ request }: FetchEvent) {
|
async fetch({ request }: FetchEvent) {
|
||||||
const urlParam = new URLSearchParams(new URL(request.url).search);
|
const urlParam = new URLSearchParams(new URL(request.url).search);
|
||||||
const { encodeUrl, decodeUrl, rewriteHeaders, rewriteHtml, rewriteJs, rewriteCss, rewriteWorkers } = self.$scramjet.shared;
|
const { encodeUrl, decodeUrl } = self.$scramjet.shared.url;
|
||||||
|
const { rewriteHeaders, rewriteHtml, rewriteJs, rewriteCss, rewriteWorkers } = self.$scramjet.shared.rewrite;
|
||||||
|
|
||||||
if (urlParam.has("url")) {
|
if (urlParam.has("url")) {
|
||||||
return Response.redirect(encodeUrl(urlParam.get("url"), new URL(urlParam.get("url"))))
|
return Response.redirect(encodeUrl(urlParam.get("url"), new URL(urlParam.get("url"))))
|
||||||
|
@ -206,7 +207,7 @@ function renderError(err, fetchedURL) {
|
||||||
"content-type": "text/html",
|
"content-type": "text/html",
|
||||||
};
|
};
|
||||||
if (crossOriginIsolated) {
|
if (crossOriginIsolated) {
|
||||||
headers["Cross-Origin-Embedd'er-Policy"] = "require-corp";
|
headers["Cross-Origin-Embedder-Policy"] = "require-corp";
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Response(
|
return new Response(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue