From 44024b44f015a2d50d23685eb3d978faa8416165 Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Sat, 13 Apr 2024 15:57:36 -0600 Subject: [PATCH] Don't eagerly write response body in case of redirect --- src/clientlayers/StreamRequest.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clientlayers/StreamRequest.jl b/src/clientlayers/StreamRequest.jl index c3bc7787..c7bf95fd 100644 --- a/src/clientlayers/StreamRequest.jl +++ b/src/clientlayers/StreamRequest.jl @@ -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) if isbytes(res.body) if length(res.body) > 0 # user-provided buffer to read response body into