Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Unreleased

- Parse path prefixes from server URLs and propagate them to all requests.

- Fixed compatibility with ``urllib3-future``.

2025/01/30 2.0.0
================

Expand Down
2 changes: 1 addition & 1 deletion src/crate/client/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def request(
if "Content-Length" not in headers:
length = super_len(data)
if length is not None:
headers["Content-Length"] = length
headers["Content-Length"] = str(length)

# Authentication credentials
if username is not None:
Expand Down
7 changes: 6 additions & 1 deletion tests/client/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@ def test_redirect_handling():
# - https://github.com/crate/crate-python/issues/179
# - https://github.com/crate/crate-python/issues/180

assert client.server_pool["http://localhost:4201"].pool.conn_kw == {
# Remove some optional server pool parameters added by `urllib3-future`.
conn_kw = client.server_pool["http://localhost:4201"].pool.conn_kw
conn_kw.pop("keepalive_delay", None)
conn_kw.pop("resolver", None)

assert conn_kw == {
"socket_options": _get_socket_opts(keepalive=True)
}

Expand Down
Loading