Comparing version 1.12.0 to 1.13.0
15
http.js
@@ -13,2 +13,4 @@ /** | ||
var Reader = require("./reader"); | ||
var iconv = require("iconv-lite"); | ||
var stripBom = require('strip-bom'); | ||
@@ -389,3 +391,14 @@ /** | ||
} | ||
return Q.post(response.body, 'read', []); | ||
return Q.post(response.body, 'read', []).then(function (data) { | ||
var contentType, match, charset; | ||
if (Buffer.isBuffer(data)) { | ||
contentType = response.headers['content-type'] || '', | ||
match = contentType.match(/charset=([a-z0-9-]+)/i), | ||
charset = match ? match[1] : 'utf8'; | ||
return iconv.decode(data, charset); | ||
} | ||
return stripBom(data); | ||
}); | ||
}); | ||
@@ -392,0 +405,0 @@ }; |
{ | ||
"name": "q-io", | ||
"version": "1.12.0", | ||
"version": "1.13.0", | ||
"description": "IO using Q promises", | ||
@@ -17,8 +17,3 @@ "homepage": "http://github.com/kriskowal/q-io/", | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://github.com/kriskowal/q-io/raw/master/LICENSE" | ||
} | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
@@ -34,3 +29,5 @@ "type": "git", | ||
"mimeparse": "^0.1.4", | ||
"collections": "^0.2.0" | ||
"collections": "^0.2.0", | ||
"iconv-lite": "^0.4.8", | ||
"strip-bom": "^1.0.0" | ||
}, | ||
@@ -37,0 +34,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
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
180579
4237
8
+ Addediconv-lite@^0.4.8
+ Addedstrip-bom@^1.0.0
+ Addedfirst-chunk-stream@1.0.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedstrip-bom@1.0.0(transitive)