diff options
author | geireann <60007097+geireann@users.noreply.github.com> | 2021-08-02 12:09:22 -0400 |
---|---|---|
committer | geireann <60007097+geireann@users.noreply.github.com> | 2021-08-02 12:09:22 -0400 |
commit | 77c6321843e6f45765155526de49aee4c041a372 (patch) | |
tree | 824aef0756f6bd4d0f8e0b3d1def024455321ed9 /src/server/server_Initialization.ts | |
parent | 149b2de414812063bc8c81305f284f74a24481cb (diff) | |
parent | 077723a6863bbb537756180450bdf9addeec021a (diff) |
Merge branch 'master' into aubrey-bugfix
Diffstat (limited to 'src/server/server_Initialization.ts')
-rw-r--r-- | src/server/server_Initialization.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/server_Initialization.ts b/src/server/server_Initialization.ts index e40f2b8e5..0f4a067fc 100644 --- a/src/server/server_Initialization.ts +++ b/src/server/server_Initialization.ts @@ -142,8 +142,9 @@ function registerCorsProxy(server: express.Express) { const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; server.use("/corsProxy", async (req, res) => { - const requrl = decodeURIComponent(req.url.substring(1)); const referer = req.headers.referer ? decodeURIComponent(req.headers.referer) : ""; + const requrlraw = decodeURIComponent(req.url.substring(1)); + const requrl = requrlraw.startsWith("/") ? referer + requrlraw : requrlraw; // cors weirdness here... // if the referer is a cors page and the cors() route (I think) redirected to /corsProxy/<path> and the requested url path was relative, // then we redirect again to the cors referer and just add the relative path. |