Socket
Socket
Sign inDemoInstall

node-fetch

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-fetch - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

8

CHANGELOG.md

@@ -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';

});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc