From aba1ea46360a1f84f71102ca3727b584faad8946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 5 Nov 2011 01:49:03 +0100 Subject: Add 'If-Modified-Since' and 'If-Unmodified-Since' to parse_header/2 Implementing the full HTTP-date type (RFC1123, RFC850, asctime). --- src/cowboy_http_req.erl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/cowboy_http_req.erl') diff --git a/src/cowboy_http_req.erl b/src/cowboy_http_req.erl index 911aca1..2b17f9c 100644 --- a/src/cowboy_http_req.erl +++ b/src/cowboy_http_req.erl @@ -236,6 +236,12 @@ parse_header(Name, Req, Default) when Name =:= 'Content-Length' -> fun (Value) -> cowboy_http:digits(Value) end); +parse_header(Name, Req, Default) + when Name =:= 'If-Modified-Since'; Name =:= 'If-Unmodified-Since' -> + parse_header(Name, Req, Default, + fun (Value) -> + cowboy_http:http_date(Value) + end); parse_header(Name, Req, Default) -> {Value, Req2} = header(Name, Req, Default), {undefined, Value, Req2}. -- cgit v1.2.3