From 68c57430daefd9a397c6c30d2168c4058409d74e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 6 Jun 2016 17:32:04 +0200 Subject: REST: If-Match uses strong Etag comparison Weak Etag never matches. --- src/cowboy_rest.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl index 2401c04..d28c8e9 100644 --- a/src/cowboy_rest.erl +++ b/src/cowboy_rest.erl @@ -683,6 +683,9 @@ if_match_exists(Req, State) -> if_match(Req, State, EtagsList) -> try generate_etag(Req, State) of + %% Strong Etag comparison: weak Etag never matches. + {{weak, _}, Req2, State2} -> + precondition_failed(Req2, State2); {Etag, Req2, State2} -> case lists:member(Etag, EtagsList) of true -> if_unmodified_since_exists(Req2, State2); -- cgit v1.2.3