mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
fix rewriter crashes (this code is bad)
This commit is contained in:
parent
7d94d54108
commit
c4f31be3ae
2 changed files with 3 additions and 1 deletions
|
@ -81,6 +81,7 @@ function traverseParsedHtml(node, origin?: URL) {
|
|||
node.attribs.content.includes("url")
|
||||
) {
|
||||
const contentArray = node.attribs.content.split("url=");
|
||||
if (contentArray[1])
|
||||
contentArray[1] = encodeUrl(contentArray[1].trim(), origin);
|
||||
node.attribs.content = contentArray.join("url=");
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ self.ScramjetServiceWorker = class ScramjetServiceWorker {
|
|||
let cookieParsed = cookie.split(";").map((x) => x.trim().split("="));
|
||||
|
||||
let [key, value] = cookieParsed.shift();
|
||||
if (!value) continue;
|
||||
value = value.replace("\"", "");
|
||||
|
||||
const hostArg = cookieParsed.find((x) => x[0] === "Domain");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue