Skip to content

Commit

Permalink
Correctly parse x-forwarded-for header.
Browse files Browse the repository at this point in the history
  • Loading branch information
EarthlingDavey committed Dec 6, 2024
1 parent 8fc950c commit 8198fd3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions conf/node/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ app.post("/spider", function (req, res) {

app.get("/access-archive", async function (req, res, next) {
try {
const clientIp = req.headers["x-forwarded-for"] || req.ip;
const clientIp = req.headers["x-forwarded-for"]?.split(',')[0];

// Get the current domain from the request
const appUrl = new URL(
Expand Down Expand Up @@ -105,8 +105,6 @@ app.get("/access-archive", async function (req, res, next) {
});
});

// http://app.archive.intranet.docker/access-archive

// Redirect to the CDN URL.
res.redirect(cdnUrl.origin);
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion deploy/development/stateful-set.tpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: StatefulSet
metadata:
name: ${KUBE_NAMESPACE}
spec:
replicas: 1
replicas: 2
revisionHistoryLimit: 5
selector:
matchLabels:
Expand Down

0 comments on commit 8198fd3

Please sign in to comment.