Closed kotx closed 6 months ago
good catch! thank you! i didnt notice that httpx changed default behaviour for redirects following. we trust in server implementation, we trust to our client implementation. so i just enabled redirects which fixes the problem. wanna mention that redirect are still disabled in identity resolvers. let's keep it simple
fixed in v0.0.46
I get this response when calling
Client.get_blob
:This is because
_handle_response
treats status codes outside the 200-299 range as errors: https://github.com/MarshalX/atproto/blob/56306ad25b1a6a042c67fdf1ae9f6037d28724dc/packages/atproto_client/request.py#L57-L66We should probably use
response.is_error
instead, which returns True for 4xx-5xx status codes. Or for a more strict policy,response.is_success or response.is_redirect
. But I'm not sure ifis_redirect
will return true after the client follows a redirect, so that might not be required.We also need to set
follow_redirects=True
inhttpx.Client.get
or when constructing thehttpx.Client
.But if you intended for
follow_redirects=True
to be passed in the**kwargs
ofget_blob
, that would be fine too.