From 33dd40896a593d9b12c07829962414032b1db86c Mon Sep 17 00:00:00 2001 From: Sebastien MALOT Date: Wed, 2 Aug 2017 18:53:42 +0200 Subject: [PATCH 1/2] Update cycle.js --- src/cycle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cycle.js b/src/cycle.js index 72fdcbc..d689c1e 100644 --- a/src/cycle.js +++ b/src/cycle.js @@ -263,7 +263,7 @@ export default class Cycle extends EventEmitter { protocol: req.protocol, proxy: upstreamProxy, hostname: req.hostname, - port: req.port || req._getDefaultPort(), + port: req.port, method: req.method, path: req.url, headers: req.headers, From 23cb7dccc40b4f9a4c68e6a296a3cce3241c8793 Mon Sep 17 00:00:00 2001 From: Sebastien Malot Date: Wed, 2 Aug 2017 18:55:17 +0200 Subject: [PATCH 2/2] Clean any instance of _getDefaultPort() function --- src/request.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/request.js b/src/request.js index 84f805b..0f73c7a 100644 --- a/src/request.js +++ b/src/request.js @@ -195,20 +195,13 @@ export default class Request extends Body { if (port){ this.port = port } - //this.port = purl.port || host.port || this._getDefaultPort() + //this.port = purl.port || host.port this.method = inReq.method this.url = purl.path inReq._isOriginal = true this._source = inReq } - /** - * Returns the default port given the current protocol. - */ - _getDefaultPort(){ - return this.protocol === 'https:' ? 443 : 80 - } - // TODO: emit debug log events for things that are changed. _finalize(){ if (nonEntityMethods.hasOwnProperty(this.method)) {