server: fix cache bust
This commit is contained in:
parent
e81d3c0324
commit
8800e7a060
1 changed files with 3 additions and 5 deletions
|
@ -8,12 +8,10 @@ class Server::ETag < Rack::ETag
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
h = ETAGS[env["REQUEST_PATH"]] || {}
|
status, headers, body = super(env)
|
||||||
if h["etag"] && h["etag"] == env["HTTP_IF_NONE_MATCH"]
|
if headers["etag"] && headers["etag"] == env["HTTP_IF_NONE_MATCH"]
|
||||||
[304, h, [""]]
|
[304, headers, [""]]
|
||||||
else
|
else
|
||||||
status, headers, body = super(env)
|
|
||||||
ETAGS[env["REQUEST_PATH"]] = headers
|
|
||||||
[status, headers, body]
|
[status, headers, body]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue