follow-redirects 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of follow-redirects might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/README.md +8 -24
  2. package/index.js +1 -1
  3. package/package.json +4 -7
package/README.md CHANGED
@@ -96,42 +96,26 @@ var followRedirects = require('follow-redirects').wrap({
96
96
 
97
97
  Such custom protocols only need an implementation of the `request` method.
98
98
 
99
- ## Browserify Usage
99
+ ## Browser Usage
100
100
 
101
- Due to the way `XMLHttpRequest` works, the `browserify` versions of `http` and `https` already follow redirects.
102
- If you are *only* targeting the browser, then this library has little value for you. If you want to write cross
103
- platform code for node and the browser, `follow-redirects` provides a great solution for making the native node
104
- modules behave the same as they do in browserified builds in the browser. To avoid bundling unnecessary code
105
- you should tell browserify to swap out `follow-redirects` with the standard modules when bundling.
106
- To make this easier, you need to change how you require the modules:
101
+ Due to the way the browser works,
102
+ the `http` and `https` browser equivalents perform redirects by default.
107
103
 
104
+ By requiring `follow-redirects` this way:
108
105
  ```javascript
109
106
  var http = require('follow-redirects/http');
110
107
  var https = require('follow-redirects/https');
111
108
  ```
109
+ you can easily tell webpack and friends to replace
110
+ `follow-redirect` by the built-in versions:
112
111
 
113
- You can then replace `follow-redirects` in your browserify configuration like so:
114
-
115
- ```javascript
116
- "browser": {
112
+ ```json
113
+ {
117
114
  "follow-redirects/http" : "http",
118
115
  "follow-redirects/https" : "https"
119
116
  }
120
117
  ```
121
118
 
122
- The `browserify-http` module has not kept pace with node development, and no long behaves identically to the native
123
- module when running in the browser. If you are experiencing problems, you may want to check out
124
- [browserify-http-2](https://www.npmjs.com/package/http-browserify-2). It is more actively maintained and
125
- attempts to address a few of the shortcomings of `browserify-http`. In that case, your browserify config should
126
- look something like this:
127
-
128
- ```javascript
129
- "browser": {
130
- "follow-redirects/http" : "browserify-http-2/http",
131
- "follow-redirects/https" : "browserify-http-2/https"
132
- }
133
- ```
134
-
135
119
  ## Contributing
136
120
 
137
121
  Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues)
package/index.js CHANGED
@@ -387,7 +387,7 @@ function urlToOptions(urlObject) {
387
387
  hash: urlObject.hash,
388
388
  search: urlObject.search,
389
389
  pathname: urlObject.pathname,
390
- path: `${urlObject.pathname}${urlObject.search}`,
390
+ path: urlObject.pathname + urlObject.search,
391
391
  href: urlObject.href,
392
392
  };
393
393
  if (urlObject.port !== "") {
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "follow-redirects",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "HTTP and HTTPS modules that follow redirects.",
5
5
  "main": "index.js",
6
+ "files": [
7
+ "*.js"
8
+ ],
6
9
  "engines": {
7
10
  "node": ">=4.0"
8
11
  },
@@ -33,12 +36,6 @@
33
36
  "Olivier Lalonde <olalonde@gmail.com> (http://www.syskall.com)",
34
37
  "James Talmage <james@talmage.io>"
35
38
  ],
36
- "files": [
37
- "index.js",
38
- "create.js",
39
- "http.js",
40
- "https.js"
41
- ],
42
39
  "dependencies": {
43
40
  "debug": "=3.1.0"
44
41
  },