diff options
| author | Bobby <[email protected]> | 2022-06-27 00:21:00 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-06-27 00:21:00 +0530 |
| commit | 6b7f5b573fc772f85374296ada7c8b1d39f3ad29 (patch) | |
| tree | 4ec7143acc65f86b1d1f29f5f469e8eb151da240 | |
| parent | 649de0647c0df90042568771cddfbc7360780f95 (diff) | |
| download | thatcomputerscientist-6b7f5b573fc772f85374296ada7c8b1d39f3ad29.tar.xz thatcomputerscientist-6b7f5b573fc772f85374296ada7c8b1d39f3ad29.zip | |
add :scheme for HTTP/2 headers compatibility
| -rw-r--r-- | functions/render.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/functions/render.js b/functions/render.js index a35860a1..c96ecf9b 100644 --- a/functions/render.js +++ b/functions/render.js @@ -6,7 +6,7 @@ function renderRoute(req, res, page, title, protected = false, data = {}) { let currentDomain = req.get("host").split("."); // get the ':scheme' from the request header - let scheme = req.headers['X-Forwarded-Proto'] || req.protocol; + let scheme = req.headers[':scheme'] || req.headers['x-forwarded-proto'] || req.protocol; currentDomain = scheme + "://" + currentDomain.at(-2) + "." + currentDomain.at(-1); jwt.verify(req.cookies.token, validationString, (err, decoded) => { if (err) { |
