@crawlee/http-client 4.0.0-beta.185 → 4.0.0-beta.187
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/base-http-client.js +8 -0
- package/package.json +3 -3
package/base-http-client.js
CHANGED
|
@@ -93,12 +93,20 @@ export class BaseHttpClient {
|
|
|
93
93
|
}
|
|
94
94
|
const nextHeaders = new Headers();
|
|
95
95
|
currentRequest.headers.forEach((value, key) => nextHeaders.set(key, value));
|
|
96
|
+
// Like native `fetch`, do not forward credentials to a different origin
|
|
97
|
+
if (nextUrl.origin !== new URL(currentRequest.url).origin) {
|
|
98
|
+
for (const header of ['authorization', 'proxy-authorization', 'cookie']) {
|
|
99
|
+
nextHeaders.delete(header);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
96
102
|
return new Request(nextUrl.toString(), {
|
|
97
103
|
method: nextMethod,
|
|
98
104
|
headers: nextHeaders,
|
|
99
105
|
body: nextBody,
|
|
100
106
|
credentials: currentRequest.credentials,
|
|
101
107
|
redirect: 'manual',
|
|
108
|
+
// Node-specific option required for a stream body, which the replayed body always is
|
|
109
|
+
duplex: 'half',
|
|
102
110
|
});
|
|
103
111
|
}
|
|
104
112
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/http-client",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.187",
|
|
4
4
|
"description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@crawlee/types": "4.0.0-beta.
|
|
50
|
+
"@crawlee/types": "4.0.0-beta.187",
|
|
51
51
|
"tough-cookie": "^6.0.0"
|
|
52
52
|
},
|
|
53
53
|
"lerna": {
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "1281760f20f7ee1181e3171d759efb055647e6c5"
|
|
61
61
|
}
|