mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
replace url.canparse with canparseurl and bind to 0.0.0.0
This commit is contained in:
parent
1fcc4efa1b
commit
77d492fffb
2 changed files with 2 additions and 2 deletions
|
@ -76,7 +76,7 @@ fastify.register(fastifyStatic, {
|
||||||
});
|
});
|
||||||
fastify.listen({
|
fastify.listen({
|
||||||
port: process.env.PORT || 1337,
|
port: process.env.PORT || 1337,
|
||||||
// host: "0.0.0.0",
|
host: "0.0.0.0",
|
||||||
});
|
});
|
||||||
|
|
||||||
writeFileSync(
|
writeFileSync(
|
||||||
|
|
|
@ -52,7 +52,7 @@ export function decodeUrl(url: string | URL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
URL.canParse(url) &&
|
canParseUrl(url) &&
|
||||||
new URL(url).pathname.startsWith(self.$scramjet.config.prefix + "worker")
|
new URL(url).pathname.startsWith(self.$scramjet.config.prefix + "worker")
|
||||||
) {
|
) {
|
||||||
return new URL(new URL(url).searchParams.get("origin")).href;
|
return new URL(new URL(url).searchParams.get("origin")).href;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue