Comparing version 1.10.5 to 1.10.6
<!-- vim:ts=4:sts=4:sw=4:et:tw=60 --> | ||
## 1.10.6 | ||
- Restores support for host negotiation terms. | ||
## 1.10.5 | ||
@@ -4,0 +8,0 @@ |
@@ -79,5 +79,10 @@ | ||
exports.Host = function (appForHost, notAcceptable) { | ||
var patterns = Object.keys(appForHost).map(function (pattern) { | ||
var table = Object.keys(appForHost).map(function (pattern) { | ||
var parts = pattern.split(":"); | ||
return [parts[0] || "*", parts[1] || "*", appForHost[pattern]]; | ||
return [ | ||
pattern, | ||
parts[0] || "*", | ||
parts[1] || "*", | ||
appForHost[pattern] | ||
]; | ||
}); | ||
@@ -89,7 +94,8 @@ if (!notAcceptable) { | ||
// find first matching host for app | ||
for (var index = 0; index < patterns.length; index++) { | ||
var pattern = patterns[index]; // [hostname, port, app] | ||
var hostname = pattern[0]; | ||
var port = pattern[1]; | ||
var app = pattern[2]; | ||
for (var index = 0; index < table.length; index++) { | ||
var row = table[index]; // [hostname, port, app] | ||
var pattern = row[0]; | ||
var hostname = row[1]; | ||
var port = row[2]; | ||
var app = row[3]; | ||
if ( | ||
@@ -99,2 +105,6 @@ (hostname === "*" || hostname === request.hostname) && | ||
) { | ||
if (!request.terms) { | ||
request.terms = {}; | ||
} | ||
request.terms.host = pattern; | ||
return app(request); | ||
@@ -101,0 +111,0 @@ } |
{ | ||
"name": "q-io", | ||
"version": "1.10.5", | ||
"version": "1.10.6", | ||
"description": "IO using Q promises", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/kriskowal/q-io/", |
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
2983077
8610