ETags are quoted, doh

This commit is contained in:
Garret Alfert 2016-03-04 19:32:36 +01:00
parent 7e2fbe1de9
commit fd3293025d
2 changed files with 3 additions and 3 deletions

View File

@ -72,14 +72,14 @@ module RemoteStorage
none_match = (server.env["HTTP_IF_NONE_MATCH"] || "").split(",").map(&:strip)
if etag
server.halt 304 if none_match.include? etag
server.halt 304 if none_match.include? %Q("#{etag}")
items = get_directory_listing_from_redis_via_lua(user, directory)
else
etag = etag_for(user, directory)
items = {}
server.halt 304 if none_match.include? etag
server.halt 304 if none_match.include? %Q("#{etag}")
end
server.headers["ETag"] = %Q("#{etag}")

View File

@ -271,7 +271,7 @@ describe "App" do
end
it "responds with 304 when IF_NONE_MATCH header contains the ETag" do
header "If-None-Match", "a693babe4b4027de2340b4f1c362d2c8"
header "If-None-Match", "\"a693babe4b4027de2340b4f1c362d2c8\""
get "/phil/food/"
last_response.status.must_equal 304