diff options
author | vkalev <vjk1883@gmail.com> | 2021-08-13 10:15:51 -0400 |
---|---|---|
committer | vkalev <vjk1883@gmail.com> | 2021-08-13 10:15:51 -0400 |
commit | 252c2a9dd86730e05637e1e32e8487cf064e0c98 (patch) | |
tree | 88c259eeacf6ae4497c3184b6bf3c42d0be2a433 /src/server/server_Initialization.ts | |
parent | b69fe78eadeb2bfa1f284e3e0333734b03b718a9 (diff) | |
parent | 136b900ed0b939c2a10b601470f764dcb50809ad (diff) |
Merge branch 'master' into ink-gfx-victor
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. |