Page MenuHomeDevCentral

D2190.diff
No OneTemporary

D2190.diff

diff --git a/routes.js b/routes.js
--- a/routes.js
+++ b/routes.js
@@ -36,7 +36,11 @@
Routes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-function isPortRequired(protocol, port) {
+function isPortRequired(protocol, forwardedProtocol, port) {
+ if (forwardedProtocol === "https") {
+ return port !== 80 && port !== 443;
+ }
+
return (protocol === "http" && port !== 80) ||
(protocol === "https" && port !== 443);
}
@@ -45,7 +49,7 @@
const port = app.get("port");
let url = req.protocol + "://" + req.hostname;
- if (isPortRequired(req.protocol, port)) {
+ if (isPortRequired(req.protocol, req.get('X-Forwarded-Proto'), port)) {
url += ":" + port;
}

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 13:41 (21 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2252527
Default Alt Text
D2190.diff (724 B)

Event Timeline