got 9.4.0 → 9.5.0
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.
- package/package.json +5 -5
- package/readme.md +5 -5
- package/source/normalize-arguments.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "got",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.5.0",
|
|
4
4
|
"description": "Simplified HTTP requests",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/got",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"electron"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@sindresorhus/is": "^0.
|
|
37
|
+
"@sindresorhus/is": "^0.14.0",
|
|
38
38
|
"@szmarczak/http-timer": "^1.1.0",
|
|
39
39
|
"cacheable-request": "^5.1.0",
|
|
40
40
|
"decompress-response": "^3.3.0",
|
|
@@ -47,17 +47,17 @@
|
|
|
47
47
|
"url-parse-lax": "^3.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"ava": "1.0.
|
|
50
|
+
"ava": "^1.0.1",
|
|
51
51
|
"coveralls": "^3.0.0",
|
|
52
52
|
"delay": "^4.1.0",
|
|
53
53
|
"form-data": "^2.3.3",
|
|
54
54
|
"get-port": "^4.0.0",
|
|
55
|
-
"np": "^3.0
|
|
55
|
+
"np": "^3.1.0",
|
|
56
56
|
"nyc": "^13.1.0",
|
|
57
57
|
"p-event": "^2.1.0",
|
|
58
58
|
"pem": "^1.13.2",
|
|
59
59
|
"proxyquire": "^2.0.1",
|
|
60
|
-
"sinon": "^7.
|
|
60
|
+
"sinon": "^7.2.2",
|
|
61
61
|
"slow-stream": "0.0.4",
|
|
62
62
|
"tempfile": "^2.0.0",
|
|
63
63
|
"tempy": "^0.2.1",
|
package/readme.md
CHANGED
|
@@ -671,7 +671,7 @@ The default Got options.
|
|
|
671
671
|
|
|
672
672
|
## Errors
|
|
673
673
|
|
|
674
|
-
Each error contains
|
|
674
|
+
Each error contains `host`, `hostname`, `method`, `path`, `protocol`, `url` and `gotOptions` properties to make debugging easier.
|
|
675
675
|
|
|
676
676
|
In Promise mode, the `response` is attached to the error.
|
|
677
677
|
|
|
@@ -689,15 +689,15 @@ When reading from response stream fails.
|
|
|
689
689
|
|
|
690
690
|
#### got.ParseError
|
|
691
691
|
|
|
692
|
-
When `json` option is enabled, server response code is 2xx, and `JSON.parse` fails.
|
|
692
|
+
When `json` option is enabled, server response code is 2xx, and `JSON.parse` fails. Includes `statusCode` and `statusMessage` properties.
|
|
693
693
|
|
|
694
694
|
#### got.HTTPError
|
|
695
695
|
|
|
696
|
-
When the server response code is not 2xx. Includes `statusCode`, `statusMessage`, and `redirectUrls` properties.
|
|
696
|
+
When the server response code is not 2xx. Includes `body`, `statusCode`, `statusMessage`, and `redirectUrls` properties.
|
|
697
697
|
|
|
698
698
|
#### got.MaxRedirectsError
|
|
699
699
|
|
|
700
|
-
When the server redirects you more than ten times. Includes a `redirectUrls` property
|
|
700
|
+
When the server redirects you more than ten times. Includes a `statusCode`, `statusMessage`, and `redirectUrls` property which is an array of the URLs Got was redirected to before giving up.
|
|
701
701
|
|
|
702
702
|
#### got.UnsupportedProtocolError
|
|
703
703
|
|
|
@@ -709,7 +709,7 @@ When the request is aborted with `.cancel()`.
|
|
|
709
709
|
|
|
710
710
|
#### got.TimeoutError
|
|
711
711
|
|
|
712
|
-
When the request is aborted due to a [timeout](#timeout)
|
|
712
|
+
When the request is aborted due to a [timeout](#timeout). Includes an `event` property.
|
|
713
713
|
|
|
714
714
|
## Aborting the request
|
|
715
715
|
|
|
@@ -116,11 +116,7 @@ const normalize = (url, options, defaults) => {
|
|
|
116
116
|
url = urlToOptions(new URL(url, options.baseUrl));
|
|
117
117
|
} else {
|
|
118
118
|
url = url.replace(/^unix:/, 'http://$&');
|
|
119
|
-
|
|
120
119
|
url = urlParseLax(url);
|
|
121
|
-
if (url.auth) {
|
|
122
|
-
throw new Error('Basic authentication must be done with the `auth` option');
|
|
123
|
-
}
|
|
124
120
|
}
|
|
125
121
|
} else if (is(url) === 'URL') {
|
|
126
122
|
url = urlToOptions(url);
|