Comparing version 1.11.6 to 1.12.0
<!-- vim:ts=4:sts=4:sw=4:et:tw=60 --> | ||
## 1.12.0 | ||
- Adds support for socket timeout on HTTP requests as `http.request({timeout: | ||
50})` @akiron | ||
## 1.11.5 | ||
@@ -4,0 +9,0 @@ |
@@ -17,50 +17,46 @@ | ||
var requestCookies = concat(hosts.map(function (host) { | ||
// delete expired cookies | ||
for (var host in hostCookies) { | ||
var pathCookies = hostCookies[host]; | ||
for (var path in pathCookies) { | ||
var cookies = pathCookies[path]; | ||
for (var name in cookies) { | ||
var cookie = cookies[name]; | ||
if (cookie.expires && cookie.expires > now) { | ||
delete cookie[name]; | ||
} | ||
// delete expired cookies | ||
for (var host in hostCookies) { | ||
var pathCookies = hostCookies[host]; | ||
for (var path in pathCookies) { | ||
var cookies = pathCookies[path]; | ||
for (var name in cookies) { | ||
var cookie = cookies[name]; | ||
if (cookie.expires && cookie.expires > now) { | ||
delete cookie[name]; | ||
} | ||
} | ||
} | ||
} | ||
// collect applicable cookies | ||
return concat( | ||
Object.keys(hostCookies) | ||
.map(function (host) { | ||
if (!hostContains(host, request.headers.host)) { | ||
return []; | ||
} | ||
var pathCookies = hostCookies[host]; | ||
return concat( | ||
Object.keys(pathCookies) | ||
.map(function (path) { | ||
if (!pathContains(path, request.path)) | ||
return []; | ||
var cookies = pathCookies[path]; | ||
return ( | ||
Object.keys(cookies) | ||
.map(function (name) { | ||
return cookies[name]; | ||
}) | ||
.filter(function (cookie) { | ||
return cookie.secure ? | ||
request.ssl : | ||
true; | ||
}) | ||
); | ||
}) | ||
) | ||
}) | ||
); | ||
// collect applicable cookies | ||
var requestCookies = concat( | ||
Object.keys(hostCookies) | ||
.map(function (host) { | ||
if (!hostContains(host, request.headers.host)) { | ||
return []; | ||
} | ||
var pathCookies = hostCookies[host]; | ||
return concat( | ||
Object.keys(pathCookies) | ||
.map(function (path) { | ||
if (!pathContains(path, request.path)) | ||
return []; | ||
var cookies = pathCookies[path]; | ||
return ( | ||
Object.keys(cookies) | ||
.map(function (name) { | ||
return cookies[name]; | ||
}) | ||
.filter(function (cookie) { | ||
return cookie.secure ? | ||
request.ssl : | ||
true; | ||
}) | ||
); | ||
}) | ||
) | ||
}) | ||
); | ||
})); | ||
if (requestCookies.length) { | ||
@@ -72,4 +68,3 @@ request.headers["cookie"] = ( | ||
cookie.key, | ||
cookie.value, | ||
cookie | ||
cookie.value | ||
); | ||
@@ -76,0 +71,0 @@ }) |
@@ -58,3 +58,3 @@ var Q = require("q"); | ||
} | ||
return Content.ok([json]); | ||
return Content.ok([json], "application/json"); | ||
}; | ||
@@ -61,0 +61,0 @@ |
@@ -20,4 +20,4 @@ | ||
var keyValue = terms.shift().split("="); | ||
parsed.key = keyValue[0]; | ||
parsed.value = keyValue[1]; | ||
parsed.key = decodeURIComponent(keyValue[0]); | ||
parsed.value = decodeURIComponent(keyValue[1]); | ||
terms.forEach(function (term) { | ||
@@ -24,0 +24,0 @@ var parts = term.split("=").map(function (part) { |
@@ -340,2 +340,8 @@ /** | ||
if (request.timeout) { | ||
_request.setTimeout(request.timeout, function() { | ||
_request.abort(); | ||
}); | ||
} | ||
Q.when(request.body, function (body) { | ||
@@ -342,0 +348,0 @@ var end, done; |
{ | ||
"name": "q-io", | ||
"version": "1.11.6", | ||
"version": "1.12.0", | ||
"description": "IO using Q promises", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/kriskowal/q-io/", |
@@ -474,3 +474,3 @@ | ||
### request | ||
### Request | ||
@@ -503,5 +503,7 @@ A complete request object has the following properties. | ||
- ``body`` an array of string or node buffers | ||
- ``timeout`` an optional socket timeout in miliseconds to thread through to | ||
the HTTP agent. | ||
- ``node`` the wrapped Node request object | ||
### response | ||
### Response | ||
@@ -508,0 +510,0 @@ A complete response object has the following properties. |
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
180127
4226
932