instance method
append_sec_fetch_site_to_vary_header
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
append_sec_fetch_site_to_vary_header()
Appends Sec-Fetch-Site to the Vary header. This ensures proper cache behavior since the response may vary based on this header.
Source
# File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 575
def append_sec_fetch_site_to_vary_header # :doc:
vary_header = response.headers["Vary"].to_s.split(",").map(&:strip).reject(&:blank?)
unless vary_header.include?("Sec-Fetch-Site")
response.headers["Vary"] = (vary_header + ["Sec-Fetch-Site"]).join(", ")
end
end
Defined in actionpack/lib/action_controller/metal/request_forgery_protection.rb line 575
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::RequestForgeryProtection