proxy-chain
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -79,2 +79,4 @@ 'use strict'; | ||
* the message and status code is sent to client. | ||
* By default, the response will have Content-Type: text/plain | ||
* and for the 407 status the Proxy-Authenticate header will be added. | ||
*/ | ||
@@ -303,4 +305,3 @@ | ||
if (funcResult && funcResult.requestAuthentication) { | ||
var headers = { 'Proxy-Authenticate': 'Basic realm="' + _this5.authRealm + '"' }; | ||
throw new RequestError('Credentials required.', 407, headers); | ||
throw new RequestError('Credentials required.', 407); | ||
} | ||
@@ -360,2 +361,11 @@ | ||
try { | ||
headers = headers || {}; | ||
if (!headers['Content-Type']) { | ||
headers['Content-Type'] = 'text/plain'; | ||
} | ||
if (statusCode === 407 && !headers['Proxy-Authenticate']) { | ||
headers['Proxy-Authenticate'] = 'Basic realm="' + this.authRealm + '"'; | ||
} | ||
var msg = 'HTTP/1.1 ' + statusCode + ' ' + _http2.default.STATUS_CODES[statusCode] + '\r\n'; | ||
@@ -362,0 +372,0 @@ _underscore2.default.each(headers, function (value, key) { |
{ | ||
"name": "proxy-chain", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.", | ||
@@ -5,0 +5,0 @@ "main": "build/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
81935
1237