html-get 2.27.20 → 2.27.21
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 +1 -1
- package/src/index.js +4 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "html-get",
|
|
3
3
|
"description": "Get the HTML from any website, fine-tuned for correction & speed",
|
|
4
4
|
"homepage": "https://nicedoc.com/microlinkhq/html-get",
|
|
5
|
-
"version": "2.27.
|
|
5
|
+
"version": "2.27.21",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"bin": {
|
package/src/index.js
CHANGED
|
@@ -129,10 +129,11 @@ const fetch = PCancelable.fn(
|
|
|
129
129
|
}
|
|
130
130
|
} catch (error) {
|
|
131
131
|
debug('fetch:error', { url, message: error.message || error, reflect })
|
|
132
|
+
const finalUrl = error.response ? error.response.url : url
|
|
132
133
|
return reflect
|
|
133
|
-
? { isRejected: true, error }
|
|
134
|
+
? { isRejected: true, error, url: finalUrl }
|
|
134
135
|
: {
|
|
135
|
-
url,
|
|
136
|
+
url: finalUrl,
|
|
136
137
|
html: '',
|
|
137
138
|
mode: 'fetch',
|
|
138
139
|
headers: error.response ? error.response.headers : {},
|
|
@@ -230,7 +231,7 @@ const prerender = PCancelable.fn(
|
|
|
230
231
|
? {
|
|
231
232
|
headers: data.headers || {},
|
|
232
233
|
html: '',
|
|
233
|
-
url,
|
|
234
|
+
url: data.url,
|
|
234
235
|
mode: 'prerender',
|
|
235
236
|
statusCode: data.error?.response?.statusCode,
|
|
236
237
|
redirects: []
|