From 6fa7659dbb1712926040a3ee257b3fbf21bfd754 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 4 Nov 2011 15:55:55 +0100 Subject: Support 'Content-Type' in parse_header/2 --- 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 12d117f..fa4e620 100644 --- a/src/cowboy_http_req.erl +++ b/src/cowboy_http_req.erl @@ -244,6 +244,11 @@ parse_header(Name, Req, Default) when Name =:= 'Content-Length' -> fun (Value) -> cowboy_http:digits(Value) end); +parse_header(Name, Req, Default) when Name =:= 'Content-Type' -> + parse_header(Name, Req, Default, + fun (Value) -> + cowboy_http:content_type(Value) + end); parse_header(Name, Req, Default) when Name =:= 'If-Match'; Name =:= 'If-None-Match' -> parse_header(Name, Req, Default, -- cgit v1.2.3