From 1a5de60976be5d0440290f626e5ef7fb07afb98a Mon Sep 17 00:00:00 2001 From: Anand Date: Sat, 15 Jul 2017 08:28:54 +1200 Subject: [PATCH] When calling client.API, allow for optional port to be assigned in endpointRequest which is then used in the buildrequest. This is to allow for environments that sit behind corporate firewalls or proxies that have strict environments were HTTPs request must have port 443 assigned during request (unlike the current default request which is empty). --- lib/client.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/client.js b/lib/client.js index d38e3fe..8f59367 100644 --- a/lib/client.js +++ b/lib/client.js @@ -58,6 +58,10 @@ function Client (globalRequest) { request.host = endpointRequest.host || globalRequest.host request.method = endpointRequest.method + if (endpointRequest.port) { + request.port = endpointRequest.port + } + // build URL request.path = !isEmpty(endpointRequest.queryParams) ? buildPath(endpointRequest.path, endpointRequest.queryParams)