Skip to content

Commit fbff605

Browse files
adamtheturtleclaude
andcommitted
Address Bugbot review feedback on HTTPXTransport
- Set tell_position to len(content) instead of 0 - Add follow_redirects=True to httpx.request() - Handle request_body None when content is empty Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5b3fd2c commit fbff605

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/vws/transports.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,18 @@ def __call__(
136136
headers=headers,
137137
content=data,
138138
timeout=httpx_timeout,
139+
follow_redirects=True,
139140
)
140141

142+
content = bytes(httpx_response.content)
143+
request_content = httpx_response.request.content
144+
141145
return Response(
142146
text=httpx_response.text,
143147
url=str(object=httpx_response.url),
144148
status_code=httpx_response.status_code,
145149
headers=dict(httpx_response.headers),
146-
request_body=bytes(httpx_response.request.content),
147-
tell_position=0,
148-
content=bytes(httpx_response.content),
150+
request_body=bytes(request_content) or None,
151+
tell_position=len(content),
152+
content=content,
149153
)

tests/test_transports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_float_timeout(self) -> None:
3232
assert isinstance(response, Response)
3333
assert response.status_code == HTTPStatus.OK
3434
assert response.text == "OK"
35-
assert response.tell_position == 0
35+
assert response.tell_position == len(b"OK")
3636

3737
@respx.mock
3838
def test_tuple_timeout(self) -> None:

0 commit comments

Comments
 (0)