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

Do not turn HEAD requests to GET by default through redirects #967

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

giordano
Copy link
Contributor

I don't think this is a breaking change, in fact I didn't have to change any existing tests: this is only a change in the default behaviour if redirect_method is not set, but the user can always override it by setting that keyword argument.

This is also consistent with what Downloads.jl does:

julia> using Downloads

julia> io = IOBuffer();

julia> Downloads.request("https://google.com/"; output=io, method="HEAD"); # The HEAD request produces an empty body also through redirect

julia> length(String(take!(io)))
0

Copy link
Member

@quinnj quinnj left a comment

Choose a reason for hiding this comment

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

Thanks @giordano!

@quinnj quinnj merged commit 9a95100 into JuliaWeb:master Nov 24, 2022
@giordano giordano deleted the mg/redirect-newmethod branch November 24, 2022 08:47
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.

2 participants