Skip to content

Commit

Permalink
Get protocol primarily from X-Forwarded-Proto header
Browse files Browse the repository at this point in the history
  • Loading branch information
jirik committed Nov 9, 2023
1 parent f1d8c04 commit cfb35a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const BASEPATH = process.env.LTC_BASEPATH;

const add_layman_proxy_headers = (proxyReq, req, res) => {
authn_util.add_authn_headers(proxyReq, req, res);
proxyReq.setHeader('X-Forwarded-Proto', req.protocol);
proxyReq.setHeader('X-Forwarded-Proto', req.get('X-Forwarded-Proto') || req.protocol);
proxyReq.setHeader('X-Forwarded-Host', req.get('host'));
proxyReq.setHeader('X-Forwarded-Prefix', BASEPATH);
}
Expand Down

0 comments on commit cfb35a0

Please sign in to comment.