Repository navigation
fix(cookie): send dict cookies as a single header - #662
patrick-immometrica wants to merge 2 commits into
Conversation
|
This doesn’t look quite right. I designed it this way to support multiple |
|
Fair point on HTTP/2 and HTTP/3: RFC 9113 §8.2.3 and RFC 9114 §4.2.1 allow splitting the Cookie header there. For HTTP/1.1 it's the opposite, RFC 6265 §5.4: "the user agent MUST NOT attach more than one Cookie header field". Right now a dict sends one line per entry over HTTP/1.1, which is what the test shows. Would you take a version that joins them only when the request goes out as HTTP/1.x, and keeps them split for h2/h3? |
|
Only the internal |
fixes how a
cookies={...}dict goes out on a request. Before, each dict entry became its own Cookie header line; nowsrc/cookie.rsjoins all entries into one header,a=1; b=2, which is the format HTTP/1.1 requires, and an empty dict sends no Cookie header at all. A new test intests/cookie_test.pysends{"a": "1", "b": "2"}to a local server and checks that exactly one line, cookie:a=1; b=2, arrives.