server: fix cache bust

This commit is contained in:
0x1eef 2023-07-09 02:16:55 -03:00
parent e81d3c0324
commit 8800e7a060

View file

@ -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