提交 a4c82d8e 编写于 作者: R Richard Schneeman

Merge pull request #23120 from vipulnsward/always-set-vary-for-static-assets

Its ideal to set Vary: Accept-Encoding, irrespective of whether gzipped or not
......@@ -65,7 +65,7 @@ def serve(request)
status, headers, body = @file_server.call(request.env)
end
headers['Vary'] = 'Accept-Encoding' if gzip_path
headers['Vary'] = 'Accept-Encoding'
return [status, headers, body]
ensure
......
......@@ -233,7 +233,7 @@ def assert_gzip(file_name, response)
def assert_html(body, response)
assert_equal body, response.body
assert_equal "text/html", response.headers["Content-Type"]
assert_nil response.headers["Vary"]
assert_not_nil response.headers["Vary"]
end
def get(path, headers = {})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册