mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:01:20 +08:00
SECURITY: Disallow caching of MIME/Content-Type errors (#14907)
This will sign intermediary proxies and/or misconfigured CDNs to not cache those error responses.
This commit is contained in:

committed by
GitHub

parent
9ca93f57cc
commit
6645243a26
@ -35,7 +35,7 @@ module Middleware
|
||||
begin
|
||||
request.format
|
||||
rescue Mime::Type::InvalidMimeType
|
||||
return [400, {}, ["Invalid MIME type"]]
|
||||
return [400, { "Cache-Control" => "private, max-age=0, must-revalidate" }, ["Invalid MIME type"]]
|
||||
end
|
||||
|
||||
if ApplicationController.rescue_with_handler(exception, object: fake_controller)
|
||||
|
Reference in New Issue
Block a user