-
Notifications
You must be signed in to change notification settings - Fork 345
Remove 'secure' attribute from cookies in ProxyGenerator to ensure co… #581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 3 commits
6f5c5df
fb58340
460a28b
599999a
0a563e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -448,6 +448,7 @@ def _handle_captcha2(self, url): | |
| cookie.pop("httpOnly", None) | ||
| cookie.pop("expiry", None) | ||
| cookie.pop("sameSite", None) | ||
| cookie.pop("secure", None) # httpx Cookies.set() does not accept 'secure' | ||
| self._session.cookies.set(**cookie) | ||
|
|
||
| return self._session | ||
|
|
@@ -478,8 +479,11 @@ def _new_session(self, **kwargs): | |
| init_kwargs.update(headers=_HEADERS) | ||
|
|
||
| if self._proxy_works: | ||
| init_kwargs["proxies"] = proxies #.get("http", None) | ||
| self._proxies = proxies | ||
| # httpx uses proxy= (single URL), not proxies= (dict) | ||
| proxy_url = proxies.get("https://") or proxies.get("http://") | ||
| if proxy_url: | ||
| init_kwargs["proxy"] = proxy_url | ||
|
Comment on lines
485
to
+490
|
||
| if self.proxy_mode is ProxyMode.SCRAPERAPI: | ||
| # SSL Certificate verification must be disabled for | ||
| # ScraperAPI requests to work. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.