aboutsummaryrefslogtreecommitdiff
path: root/src/server/server_Initialization.ts
diff options
context:
space:
mode:
authorJames Hu <51237606+jameshu111@users.noreply.github.com>2023-07-26 12:15:46 -0400
committerJames Hu <51237606+jameshu111@users.noreply.github.com>2023-07-26 12:15:46 -0400
commit4a8cf5ee3fd6f01ff2d28ccc0a456e9782bd261b (patch)
treea1a4ac7200a38f55227fff941d8d7246cb85eebf /src/server/server_Initialization.ts
parent7c1017f15b9c0ad09d3e0185e310733ab7c10c09 (diff)
parentc87024c06941920f1df689d54d82cc309891e3d2 (diff)
Merge branch 'master' into james-azure-image
Diffstat (limited to 'src/server/server_Initialization.ts')
-rw-r--r--src/server/server_Initialization.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/server_Initialization.ts b/src/server/server_Initialization.ts
index 805da1d43..c38ee8ac9 100644
--- a/src/server/server_Initialization.ts
+++ b/src/server/server_Initialization.ts
@@ -234,8 +234,10 @@ function proxyServe(req: any, requrl: string, response: any) {
function registerEmbeddedBrowseRelativePathHandler(server: express.Express) {
server.use('*', (req, res) => {
const relativeUrl = req.originalUrl;
- if (!req.user) res.redirect('/home'); // When no user is logged in, we interpret a relative URL as being a reference to something they don't have access to and redirect to /home
- else if (!res.headersSent && req.headers.referer?.includes('corsProxy')) {
+ // if (req.originalUrl === '/css/main.css' || req.originalUrl === '/favicon.ico') res.end();
+ // else
+ if (!res.headersSent && req.headers.referer?.includes('corsProxy')) {
+ if (!req.user) res.redirect('/home'); // When no user is logged in, we interpret a relative URL as being a reference to something they don't have access to and redirect to /home
// a request for something by a proxied referrer means it must be a relative reference. So construct a proxied absolute reference here.
try {
const proxiedRefererUrl = decodeURIComponent(req.headers.referer); // (e.g., http://localhost:<port>/corsProxy/https://en.wikipedia.org/wiki/Engelbart)