aboutsummaryrefslogtreecommitdiff
path: root/src/server/server_Initialization.ts
diff options
context:
space:
mode:
authorAubrey-Li <63608597+Aubrey-Li@users.noreply.github.com>2021-08-03 16:57:25 -0700
committerAubrey-Li <63608597+Aubrey-Li@users.noreply.github.com>2021-08-03 16:57:25 -0700
commitfaa2449d0667507b5424984c0f1d70886d0cb025 (patch)
tree02a984b9b8fb2b8e3c4c93f102d9c4b700ff0fda /src/server/server_Initialization.ts
parentf4b910cc51c7c6b9c794d1b59198d132af3580b7 (diff)
parent0e8aef275346b4ba3bc1bb91fda17a335c307bf1 (diff)
Merge branch 'master' into trails-aubrey
Diffstat (limited to 'src/server/server_Initialization.ts')
-rw-r--r--src/server/server_Initialization.ts3
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.