Skip to content
Open
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: 1 addition & 1 deletion src/clientlayers/StreamRequest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ end

function readbody!(stream::Stream, res::Response, buf_or_stream, lock)
n = 0
if !iserror(res)
if !iserror(res) && !isredirect(res)
Copy link
Member

@fredrikekre fredrikekre Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is sufficient, you also need to check if this redirect is to be followed or not (redirect::Bool and redirect_limit::Int arguments).

This case doesn't seem to be tested either since HTTP.get("http://localhost:8123"; redirect=false, response_stream = stderr); from the issue description gives no body at all with this PR.

if isbytes(res.body)
if length(res.body) > 0
# user-provided buffer to read response body into
Expand Down