diff --git a/lib/remote_storage/swift.rb b/lib/remote_storage/swift.rb index e8a9a7d..6a88013 100644 --- a/lib/remote_storage/swift.rb +++ b/lib/remote_storage/swift.rb @@ -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}") diff --git a/spec/swift/app_spec.rb b/spec/swift/app_spec.rb index 0da57a4..1f244f7 100644 --- a/spec/swift/app_spec.rb +++ b/spec/swift/app_spec.rb @@ -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