node-fetch
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -8,6 +8,10 @@ | ||
## v1.3.0 (master) | ||
## v1.3.1 (master) | ||
- Enhance: now fetch.Request is exposed as well. | ||
- Enhance: allow custom host header to be set (server-side only feature, as it's a forbidden header on client-side) | ||
## v1.3.0 | ||
- Enhance: now fetch.Request is exposed as well | ||
## v1.2.1 | ||
@@ -14,0 +18,0 @@ |
@@ -82,2 +82,7 @@ | ||
// http.request only support string as host header, this hack make custom host header possible | ||
if (options.headers.host) { | ||
options.headers.host = options.headers.host[0]; | ||
} | ||
// send request | ||
@@ -84,0 +89,0 @@ var req = send(options); |
{ | ||
"name": "node-fetch", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A light-weight module that brings window.fetch to node.js and io.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -164,2 +164,16 @@ | ||
it('should accept custom host header', function() { | ||
url = base + '/inspect'; | ||
opts = { | ||
headers: { | ||
host: 'example.com' | ||
} | ||
}; | ||
return fetch(url, opts).then(function(res) { | ||
return res.json(); | ||
}).then(function(res) { | ||
expect(res.headers['host']).to.equal('example.com'); | ||
}); | ||
}); | ||
it('should follow redirect code 301', function() { | ||
@@ -755,2 +769,3 @@ url = base + '/redirect/301'; | ||
}); | ||
}); |
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
48233
1338
76