Skip to content
Snippets Groups Projects
Commit 14644d40 authored by Douwe Maan's avatar Douwe Maan
Browse files

Do not validate CSRF token in API unless needed

parent 6fe736f2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -48,8 +48,8 @@ module API
end
 
before { header['X-Frame-Options'] = 'SAMEORIGIN' }
before { Gitlab::I18n.locale = current_user&.preferred_language }
 
# The locale is set to the current user's locale when `current_user` is loaded
after { Gitlab::I18n.use_default_locale }
 
rescue_from Gitlab::Access::AccessDeniedError do
Loading
Loading
Loading
Loading
@@ -16,6 +16,8 @@ module API
 
@current_user = initial_current_user
 
Gitlab::I18n.locale = @current_user&.preferred_language
sudo!
 
@current_user
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment