Repository navigation
Fix params, empty cookies, multiple_domains, per-request timeout and https-only proxies - #161
Merged
Merged
Conversation
A cookie with an empty value raised KeyError on lookup, and multiple_domains() reported a repeated domain instead of a second distinct one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- params extend a query string the URL already has, and self.params is sent with every request; request params replace session params of the same name. - The library keeps the timeout and certificate verification of a native session's first request, so each combination of the two gets its own native session. close() destroys all of them. - A proxy dict with only an "https" entry is used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the last five
xfailmarkers.?page=2plusparams={"q": "x"}now gives?page=2&q=xinstead of?page=2?q=x. The params go before a fragment, and empty params leave the URL as it is (before,params={}added a bare?).session.paramsis sent with every request. A request param replaces the session param of the same name.jar["consent"]returns""instead of raisingKeyError. Two matching cookies with empty values now raiseCookieConflictError, as two non-empty ones already did.multiple_domains()returns True when the jar has two distinct domains. Before, it returned True only for a repeated domain.timeout/insecure_skip_verify: the library fixes both when a native session sends its first request. Each combination of the two now gets its own native session, with an ID built from the session ID and the two values.close()destroys all of them and returns the library's reply for the last one. The tradeoff is that requests with different settings don't share connections. A new integration test coversinsecure_skip_verifyin both directions."https": now used. When both entries are set,"http"still wins for every URL, as before.Not changed: cookies passed to a single request are still added to the session jar, as decided in #160. Session attributes changed after the first request (for example
force_http1or the TLS settings) still keep their first value in the native session, the same way the timeout used to.uv run pytest: 478 passed. Ruff and mypy are clean. Without thesessions.pychange, the three integration tests for the first-request settings fail.🤖 Generated with Claude Code