http2-wrapper
Advanced tools
Comparing version 2.1.7 to 2.1.8
{ | ||
"name": "http2-wrapper", | ||
"version": "2.1.7", | ||
"version": "2.1.8", | ||
"description": "HTTP2 client, just with the familiar `https` API", | ||
@@ -5,0 +5,0 @@ "main": "source", |
@@ -406,2 +406,18 @@ 'use strict'; | ||
// Node.js return https://false:443 instead of https://1.1.1.1:443 | ||
const getOriginSet = () => { | ||
const {socket} = session; | ||
let originSet; | ||
if (socket.servername === false) { | ||
socket.servername = socket.remoteAddress; | ||
originSet = session.originSet; | ||
socket.servername = false; | ||
} else { | ||
originSet = session.originSet; | ||
} | ||
return originSet; | ||
}; | ||
const isFree = () => session[kCurrentStreamCount] < session.remoteSettings.maxConcurrentStreams; | ||
@@ -507,3 +523,3 @@ | ||
session.on('origin', () => { | ||
session[kOriginSet] = session.originSet || []; | ||
session[kOriginSet] = getOriginSet() || []; | ||
session[kGracefullyClosing] = false; | ||
@@ -544,3 +560,3 @@ closeSessionIfCovered(this.sessions[normalizedOptions], session); | ||
session[kOriginSet] = session.originSet || []; | ||
session[kOriginSet] = getOriginSet() || []; | ||
@@ -547,0 +563,0 @@ if (session.socket.encrypted) { |
'use strict'; | ||
const {isIP} = require('net'); | ||
const assert = require('assert'); | ||
module.exports = host => { | ||
// Note: 1.1.1.1 is a valid servername as well! | ||
const getHost = host => { | ||
if (host[0] === '[') { | ||
@@ -21,1 +20,11 @@ const idx = host.indexOf(']'); | ||
}; | ||
module.exports = host => { | ||
const servername = getHost(host); | ||
if (isIP(servername)) { | ||
return ''; | ||
} | ||
return servername; | ||
}; |
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
Network access
Supply chain riskThis module accesses the network.
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
74892
1885
13