aboutsummaryrefslogtreecommitdiff
path: root/src/server/server_Initialization.ts
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2021-09-12 12:32:49 -0400
committermehekj <mehek.jethani@gmail.com>2021-09-12 12:32:49 -0400
commitd71bc56628c2193b537b92a186785eaffa3a1eef (patch)
tree0e346527d01ef4d32a28cf9738323c6f49656dfb /src/server/server_Initialization.ts
parent23db5275a9477d5894e76a2ad6f1795fb0f99b71 (diff)
parent9ac6931dabac40a7e530d144c1d1123548de373f (diff)
Merge branch 'master' into temporalmedia-mehek
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.