aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-06-06 17:32:04 +0200
committerLoïc Hoguin <[email protected]>2016-06-06 17:32:04 +0200
commit68c57430daefd9a397c6c30d2168c4058409d74e (patch)
treeb5f06da1afe67a3d15ff569feda3c9d4a44081ac /src
parent84b3b61b392c00789cabe2f6f736c0a116f0fb85 (diff)
downloadcowboy-68c57430daefd9a397c6c30d2168c4058409d74e.tar.gz
cowboy-68c57430daefd9a397c6c30d2168c4058409d74e.tar.bz2
cowboy-68c57430daefd9a397c6c30d2168c4058409d74e.zip
REST: If-Match uses strong Etag comparison
Weak Etag never matches.
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_rest.erl3
1 files changed, 3 insertions, 0 deletions
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);