agentkeepalive
Advanced tools
Comparing version 3.4.0 to 3.4.1
3.4.1 / 2018-03-08 | ||
================== | ||
**fixes** | ||
* [[`4d3a3b1`](http://github.com/node-modules/agentkeepalive/commit/4d3a3b1f7b16595febbbd39eeed72b2663549014)] - fix: Handle ipv6 addresses in host-header correctly with TLS (#53) (Mattias Holmlund <<u376@m1.holmlund.se>>) | ||
**others** | ||
* [[`55a7a5c`](http://github.com/node-modules/agentkeepalive/commit/55a7a5cd33e97f9a8370083dcb041c5552f10ac9)] - test: stop timer after test end (fengmk2 <<fengmk2@gmail.com>>) | ||
3.4.0 / 2018-02-27 | ||
@@ -3,0 +12,0 @@ ================== |
@@ -199,9 +199,4 @@ // Copyright Joyent, Inc. and other Node contributors. | ||
if (!options.servername) { | ||
options.servername = options.host; | ||
const hostHeader = req.getHeader('host'); | ||
if (hostHeader) { | ||
options.servername = hostHeader.replace(/:.*$/, ''); | ||
} | ||
} | ||
if (!options.servername) | ||
options.servername = calculateServerName(options, req); | ||
@@ -262,9 +257,4 @@ var name = this.getName(options); | ||
if (!options.servername) { | ||
options.servername = options.host; | ||
const hostHeader = req.getHeader('host'); | ||
if (hostHeader) { | ||
options.servername = hostHeader.replace(/:.*$/, ''); | ||
} | ||
} | ||
if (!options.servername) | ||
options.servername = calculateServerName(options, req); | ||
@@ -347,2 +337,25 @@ var name = self.getName(options); | ||
function calculateServerName(options, req) { | ||
let servername = options.host; | ||
const hostHeader = req.getHeader('host'); | ||
if (hostHeader) { | ||
// abc => abc | ||
// abc:123 => abc | ||
// [::1] => ::1 | ||
// [::1]:123 => ::1 | ||
if (hostHeader.startsWith('[')) { | ||
const index = hostHeader.indexOf(']'); | ||
if (index === -1) { | ||
// Leading '[', but no ']'. Need to do something... | ||
servername = hostHeader; | ||
} else { | ||
servername = hostHeader.substr(1, index - 1); | ||
} | ||
} else { | ||
servername = hostHeader.split(':', 1)[0]; | ||
} | ||
} | ||
return servername; | ||
} | ||
Agent.prototype.removeSocket = function removeSocket(s, options) { | ||
@@ -349,0 +362,0 @@ var name = this.getName(options); |
{ | ||
"name": "agentkeepalive", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"description": "Missing keepalive http.Agent", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31581
518