From f51493ee376f0ea9eef137f19e6fd0e16e199b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 20 Feb 2012 08:25:05 +0100 Subject: 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. --- src/cowboy_http_req.erl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/cowboy_http_req.erl') 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, -- cgit v1.2.3