Allow API JSON requests to sidestep csrf protection
This commit is contained in:
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 ]
|
||||
|
||||
Reference in New Issue
Block a user