diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cow_http_hd.erl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl index 0728a47..89f9ac9 100644 --- a/src/cow_http_hd.erl +++ b/src/cow_http_hd.erl @@ -23,6 +23,7 @@ -export([parse_content_type/1]). -export([parse_expect/1]). -export([parse_if_modified_since/1]). +-export([parse_if_unmodified_since/1]). -export([parse_max_forwards/1]). -export([parse_transfer_encoding/1]). @@ -1008,6 +1009,20 @@ parse_if_modified_since_test_() -> [{V, fun() -> R = parse_if_modified_since(V) end} || {V, R} <- Tests]. -endif. +%% @doc Parse the If-Unmodified-Since header. + +-spec parse_if_unmodified_since(binary()) -> calendar:datetime(). +parse_if_unmodified_since(IfModifiedSince) -> + http_date(IfModifiedSince). + +-ifdef(TEST). +parse_if_unmodified_since_test_() -> + Tests = [ + {<<"Sat, 29 Oct 1994 19:43:31 GMT">>, {{1994, 10, 29}, {19, 43, 31}}} + ], + [{V, fun() -> R = parse_if_unmodified_since(V) end} || {V, R} <- Tests]. +-endif. + %% @doc Parse the Max-Forwards header. -spec parse_max_forwards(binary()) -> integer(). |