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

Remove workaround for old HTTP.jl version? #618

Open
BioTurboNick opened this issue Apr 30, 2023 · 0 comments
Open

Remove workaround for old HTTP.jl version? #618

BioTurboNick opened this issue Apr 30, 2023 · 0 comments

Comments

@BioTurboNick
Copy link

get_response = function ()
# Use a sacrificial I/O stream so that we only write to the `response_stream`
# once even with multiple attempted requests. Additionally this works around the
# HTTP.jl issue (https://github.com/JuliaWeb/HTTP.jl/issues/543) where the
# `response_stream` is closed automatically. Effectively, this works as if we're
# not using streaming I/O at all, as we write all data at once, but only
# returning data via I/O ensures we aren't relying on response's body being
# populated.
buffer = Base.BufferStream()
response = @mock HTTP.request(
request.request_method,
HTTP.URI(request.url),
HTTP.mkheaders(request.headers),
request.content;
redirect=false,
retry=false,
response_stream=buffer,
http_options...,
)

Noticed this appears to be a leftover from pre-v1 HTTP.jl behavior.

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

No branches or pull requests

1 participant