bdy 1.9.4 → 1.9.5-dev

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.9.4",
4
+ "version": "1.9.5-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -161,7 +161,14 @@ async function scrapeResources({ url, devices, resourceDiscoveryTimeout, cookies
161
161
  height: devices[0].viewport.height,
162
162
  deviceScaleFactor: devices[0].devicePixelRatio,
163
163
  });
164
- await page.setCookie(...cookies);
164
+ const preparedCookies = cookies.map((cookie) => {
165
+ const cookieMustBeSecure = ['__Secure-', '__Host-'].some((prefix) => cookie.name.startsWith(prefix));
166
+ return {
167
+ ...cookie,
168
+ secure: cookieMustBeSecure ? true : cookie.secure,
169
+ };
170
+ });
171
+ await page.setCookie(...preparedCookies);
165
172
  page.on('response', async (response) => {
166
173
  const request = response.request();
167
174
  const requestUrl = request.url();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.9.4",
4
+ "version": "1.9.5-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {