mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 05:00:24 +00:00
Add 'Expect' header parsing
At the same time renaming cowboy_http:content_type_params/3 to cowboy_http:params/2 (with a default Acc of []) as this code isn't useful only for content types.
This commit is contained in:
parent
e7b6e2a402
commit
f51493ee37
3 changed files with 58 additions and 31 deletions
|
@ -271,6 +271,11 @@ parse_header(Name, Req, Default) when Name =:= 'Content-Type' ->
|
|||
fun (Value) ->
|
||||
cowboy_http:content_type(Value)
|
||||
end);
|
||||
parse_header(Name, Req, Default) when Name =:= 'Expect' ->
|
||||
parse_header(Name, Req, Default,
|
||||
fun (Value) ->
|
||||
cowboy_http:nonempty_list(Value, fun cowboy_http:expectation/2)
|
||||
end);
|
||||
parse_header(Name, Req, Default)
|
||||
when Name =:= 'If-Match'; Name =:= 'If-None-Match' ->
|
||||
parse_header(Name, Req, Default,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue