mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 05:00:24 +00:00
Merge branch 'resp-body-fix' of github.com:klaar/cowboy
This commit is contained in:
commit
740931131b
2 changed files with 2 additions and 2 deletions
|
@ -68,7 +68,7 @@
|
||||||
%% Response.
|
%% Response.
|
||||||
resp_state = waiting :: locked | waiting | chunks | done,
|
resp_state = waiting :: locked | waiting | chunks | done,
|
||||||
resp_headers = [] :: http_headers(),
|
resp_headers = [] :: http_headers(),
|
||||||
resp_body = <<>> :: binary(),
|
resp_body = <<>> :: iodata(),
|
||||||
|
|
||||||
%% Functions.
|
%% Functions.
|
||||||
urldecode :: {fun((binary(), T) -> binary()), T}
|
urldecode :: {fun((binary(), T) -> binary()), T}
|
||||||
|
|
|
@ -416,7 +416,7 @@ has_resp_header(Name, #http_req{resp_headers=RespHeaders}) ->
|
||||||
%% @doc Return whether a body has been set for the response.
|
%% @doc Return whether a body has been set for the response.
|
||||||
-spec has_resp_body(#http_req{}) -> boolean().
|
-spec has_resp_body(#http_req{}) -> boolean().
|
||||||
has_resp_body(#http_req{resp_body=RespBody}) ->
|
has_resp_body(#http_req{resp_body=RespBody}) ->
|
||||||
byte_size(RespBody) > 0.
|
iolist_size(RespBody) > 0.
|
||||||
|
|
||||||
%% @equiv reply(Status, [], [], Req)
|
%% @equiv reply(Status, [], [], Req)
|
||||||
-spec reply(http_status(), #http_req{}) -> {ok, #http_req{}}.
|
-spec reply(http_status(), #http_req{}) -> {ok, #http_req{}}.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue