Skip to content

Commit c3380aa

Browse files
authored
Fix Req streaming by using response.body.ref (#65)
With Req's `into: :self`, the response body is a `Req.Response.Async` struct, not a ref directly. Extract the ref field to match messages correctly in the receive block.
1 parent 228caf6 commit c3380aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/hexdocs/http.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ defmodule Hexdocs.HTTP do
2727
def get_stream(url, headers) do
2828
case Req.get(url, headers: headers, retry: false, decode_body: false, into: :self) do
2929
{:ok, response} ->
30-
stream = stream_body(response.body)
30+
stream = stream_body(response.body.ref)
3131
{:ok, response.status, normalize_headers(response.headers), stream}
3232

3333
{:error, reason} ->

0 commit comments

Comments
 (0)