follow-redirects
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -5,2 +5,3 @@ 'use strict'; | ||
var assert = require('assert'); | ||
var consume = require('stream-consume'); | ||
@@ -44,3 +45,3 @@ module.exports = function(_nativeProtocols) { | ||
// to consume the stream and send the 'end' event | ||
res.on('data', function() {}); | ||
consume(res); | ||
@@ -47,0 +48,0 @@ // need to use url.resolve() in case location is a relative URL |
{ | ||
"name": "follow-redirects", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "HTTP and HTTPS modules that follow redirects.", | ||
@@ -45,3 +45,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"debug": "^2.2.0" | ||
"debug": "^2.2.0", | ||
"stream-consume": "^0.1.0" | ||
}, | ||
@@ -48,0 +49,0 @@ "devDependencies": { |
@@ -13,3 +13,3 @@ ## Follow Redirects | ||
`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback) | ||
`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback) | ||
methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback) | ||
@@ -52,3 +52,3 @@ modules, with the exception that they will seamlessly follow redirects. | ||
}, function (res) { | ||
console.log(res.fetchedUrls); | ||
console.log(res.fetchedUrls); | ||
// [ 'http://duckduckgo.com/robots.txt', 'http://bitly.com/UHfDGO' ] | ||
@@ -61,3 +61,3 @@ }); | ||
Due to the way `XMLHttpRequest` works, the `browserify` versions of `http` and `https` already follow redirects. | ||
If you are *only* targetting the browser, then this library has little value for you. If you want to write cross | ||
If you are *only* targetting the browser, then this library has little value for you. If you want to write cross | ||
platform code for node and the browser, `follow-redirects` provides a great solution for making the native node | ||
@@ -84,6 +84,6 @@ modules behave the same as they do in browserified builds in the browser. To avoid bundling unnecessary code | ||
module when running in the browser. If you are experiencing problems, you may want to check out | ||
[browserify-http-2](https://www.npmjs.com/package/http-browserify-2). It is more actively maintained and | ||
[browserify-http-2](https://www.npmjs.com/package/http-browserify-2). It is more actively maintained and | ||
attempts to address a few of the shortcomings of `browserify-http`. In that case, your browserify config should | ||
look something like this: | ||
```javascript | ||
@@ -101,3 +101,3 @@ "browser": { | ||
by tests. You can run the test suite locally with a simple `npm test` command. | ||
## Debug Logging | ||
@@ -104,0 +104,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11347
140
2
+ Addedstream-consume@^0.1.0
+ Addedstream-consume@0.1.1(transitive)