Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't eagerly write response body in case of redirect #1168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Apr 13, 2024

No description provided.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.78%. Comparing base (e27493d) to head (44024b4).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1168      +/-   ##
==========================================
+ Coverage   82.62%   82.78%   +0.15%     
==========================================
  Files          32       32              
  Lines        3051     3079      +28     
==========================================
+ Hits         2521     2549      +28     
  Misses        530      530              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants