replace url.canparse with canparseurl and bind to 0.0.0.0

This commit is contained in:
ProgrammerIn-wonderland 2024-08-11 21:57:41 -04:00
parent 1fcc4efa1b
commit 77d492fffb
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -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(

View file

@ -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;