Skip to content

Fix params, empty cookies, multiple_domains, per-request timeout and https-only proxies - #161

Merged
FlorianREGAZ merged 2 commits into
mainfrom
fix/params-cookies-timeout
Oct 10, 2026
Merged

FlorianREGAZ merged 2 commits into
mainfrom
fix/params-cookies-timeout

Conversation

@FlorianREGAZ

Copy link
Copy Markdown
Owner

Removes the last five xfail markers.

  • params on a URL with a query string: ?page=2 plus params={"q": "x"} now gives ?page=2&q=x instead 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.params is sent with every request. A request param replaces the session param of the same name.
  • Empty cookie values: jar["consent"] returns "" instead of raising KeyError. Two matching cookies with empty values now raise CookieConflictError, 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.
  • Per-request 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 covers insecure_skip_verify in both directions.
  • Proxy dict with only "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_http1 or 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 the sessions.py change, the three integration tests for the first-request settings fail.

🤖 Generated with Claude Code

FlorianREGAZ and others added 2 commits October 10, 2026 14:10
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>
@FlorianREGAZ
FlorianREGAZ merged commit cc4f3a9 into main Oct 10, 2026
33 of 34 checks passed
@FlorianREGAZ
FlorianREGAZ deleted the fix/params-cookies-timeout branch October 10, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant