aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_req.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-02-20 08:25:05 +0100
committerLoïc Hoguin <[email protected]>2012-02-20 08:25:05 +0100
commitf51493ee376f0ea9eef137f19e6fd0e16e199b8e (patch)
treef5aba326ddb41d128062182fb3c104ca7bc9d680 /src/cowboy_http_req.erl
parente7b6e2a402922724ffd668161ed1b65533b5c034 (diff)
downloadcowboy-f51493ee376f0ea9eef137f19e6fd0e16e199b8e.tar.gz
cowboy-f51493ee376f0ea9eef137f19e6fd0e16e199b8e.tar.bz2
cowboy-f51493ee376f0ea9eef137f19e6fd0e16e199b8e.zip
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.
Diffstat (limited to 'src/cowboy_http_req.erl')
-rw-r--r--src/cowboy_http_req.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cowboy_http_req.erl b/src/cowboy_http_req.erl
index 92d96ad..e3efd2b 100644
--- a/src/cowboy_http_req.erl
+++ b/src/cowboy_http_req.erl
@@ -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,