aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-11-30 15:01:01 +0100
committerLoïc Hoguin <[email protected]>2017-11-30 15:01:01 +0100
commit2185198deee93ce3c6f92467ccf0c8ab50c8f356 (patch)
tree7c11f9adcca31e89d6b82d6bf5af0fc8e4e8bde7 /src
parenta66eb5cd6e6c6b7a1948e3dde53a56017705a4f4 (diff)
downloadcowboy-2185198deee93ce3c6f92467ccf0c8ab50c8f356.tar.gz
cowboy-2185198deee93ce3c6f92467ccf0c8ab50c8f356.tar.bz2
cowboy-2185198deee93ce3c6f92467ccf0c8ab50c8f356.zip
Fix HTTP/2 push
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_http2.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cowboy_http2.erl b/src/cowboy_http2.erl
index 81e2a88..3aa0ad0 100644
--- a/src/cowboy_http2.erl
+++ b/src/cowboy_http2.erl
@@ -601,10 +601,10 @@ commands(State0=#state{socket=Socket, transport=Transport, server_streamid=Promi
{<<"https">>, 443} -> Host;
_ -> iolist_to_binary([Host, $:, integer_to_binary(Port)])
end,
- PathWithQs = case Qs of
+ PathWithQs = iolist_to_binary(case Qs of
<<>> -> Path;
_ -> [Path, $?, Qs]
- end,
+ end),
%% We need to make sure the header value is binary before we can
%% pass it to stream_req_init, as it expects them to be flat.
Headers1 = maps:map(fun(_, V) -> iolist_to_binary(V) end, Headers0),
@@ -612,7 +612,7 @@ commands(State0=#state{socket=Socket, transport=Transport, server_streamid=Promi
<<":method">> => Method,
<<":scheme">> => Scheme,
<<":authority">> => Authority,
- <<":path">> => iolist_to_binary(PathWithQs)},
+ <<":path">> => PathWithQs},
{HeaderBlock, EncodeState} = headers_encode(Headers, EncodeState0),
Transport:send(Socket, cow_http2:push_promise(StreamID, PromisedStreamID, HeaderBlock)),
State = stream_req_init(State0#state{server_streamid=PromisedStreamID + 2,
@@ -620,7 +620,7 @@ commands(State0=#state{socket=Socket, transport=Transport, server_streamid=Promi
method => Method,
scheme => Scheme,
authority => Authority,
- path => Path
+ path => PathWithQs
}),
commands(State, Stream, Tail);
commands(State=#state{socket=Socket, transport=Transport, remote_window=ConnWindow},