Allow API JSON requests to sidestep csrf protection

This commit is contained in:
David Heinemeier Hansson
2025-12-02 15:34:20 +01:00
committed by Stanko K.R.
parent 0ce3a85778
commit efbd2cc3da
@@ -12,7 +12,7 @@ module RequestForgeryProtection
end
def verified_request?
super || safe_fetch_site?
super || safe_fetch_site? || request.format.json?
end
SAFE_FETCH_SITES = %w[ same-origin same-site ]