mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 04:10:24 +00:00
Improve the error when trying to send a 204/304 with a body
This commit is contained in:
parent
e4a78aaeb1
commit
a40bab8fb3
2 changed files with 16 additions and 11 deletions
|
@ -182,10 +182,10 @@ do(<<"reply4">>, Req0, Opts) ->
|
|||
ct_helper:ignore(erlang, iolist_size, 1),
|
||||
cowboy_req:reply(200, #{}, ok, Req0);
|
||||
<<"204body">> ->
|
||||
ct_helper:ignore(cowboy_req, reply, 4),
|
||||
ct_helper:ignore(cowboy_req, do_reply_ensure_no_body, 4),
|
||||
cowboy_req:reply(204, #{}, <<"OK">>, Req0);
|
||||
<<"304body">> ->
|
||||
ct_helper:ignore(cowboy_req, reply, 4),
|
||||
ct_helper:ignore(cowboy_req, do_reply_ensure_no_body, 4),
|
||||
cowboy_req:reply(304, #{}, <<"OK">>, Req0);
|
||||
Status ->
|
||||
cowboy_req:reply(binary_to_integer(Status), #{}, <<"OK">>, Req0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue