Skip to content

Commit c1990e9

Browse files
committed
Consumer should be able to enable ignoreInvalidCookies
1 parent 515a7e4 commit c1990e9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ npm i puppeteer-page-proxy
2121
- `proxy` <[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|[object](https://developer.mozilla.org/en-US/docs/Glossary/Object)> Proxy to use in the current page.
2222
* Begins with a protocol (e.g. http://, https://, socks://)
2323
* In the case of [proxy per request](https://github.com/Cuadrix/puppeteer-page-proxy#proxy-per-request), this can be an object with optional properties for overriding requests:\
24-
`url`, `method`, `postData`, `headers`\
24+
`url`, `method`, `postData`, `headers`, `ignoreInvalidCookies`\
2525
See [httpRequest.continue](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#httprequestcontinueoverrides) for more info about the above properties.
2626

2727
#### PageProxy.lookup(page[, lookupService, isJSON, timeout])

src/core/proxy.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ const requestHandler = async (request, proxy, overrides = {}) => {
1919
agent: setAgent(proxy),
2020
responseType: "buffer",
2121
maxRedirects: 15,
22-
throwHttpErrors: false
22+
throwHttpErrors: false,
23+
ignoreInvalidCookies:
24+
typeof overrides.ignoreInvalidCookies === "undefined"
25+
? false
26+
: overrides.ignoreInvalidCookies
2327
};
2428
try {
2529
const response = await got(overrides.url || request.url(), options);
@@ -94,4 +98,4 @@ const useProxy = async (target, data) => {
9498
}
9599
};
96100

97-
module.exports = useProxy;
101+
module.exports = useProxy;

0 commit comments

Comments
 (0)