0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00

Add a test for early errors that occur on the request-line

This commit is contained in:
Loïc Hoguin 2017-11-20 16:26:37 +01:00
parent 92672b49af
commit 3da9a6eef9
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
2 changed files with 52 additions and 6 deletions

View file

@ -1108,8 +1108,10 @@ connection_hd_is_close(Conn) ->
-spec error_terminate(cowboy:http_status(), #state{}, _) -> no_return().
error_terminate(StatusCode, State=#state{ref=Ref, peer=Peer, in_state=StreamState}, Reason) ->
PartialReq = case StreamState of
#ps_request_line{} ->
#{};
#ps_request_line{} -> #{
ref => Ref,
peer => Peer
};
#ps_header{method=Method, path=Path, qs=Qs,
version=Version, headers=ReqHeaders} -> #{
ref => Ref,