Skip to content
Snippets Groups Projects
Commit 86c0c086 authored by Nick Thomas's avatar Nick Thomas
Browse files

Switch from request to env in ::API::Helpers

Per https://gitlab.com/gitlab-org/gitlab-ce/issues/22820, this helper is mixed
in to classes that lack a `request` method. They do include `env`, so use it
instead.
parent 9802d388
No related branches found
No related tags found
No related merge requests found
Loading
@@ -25,7 +25,7 @@ module API
Loading
@@ -25,7 +25,7 @@ module API
# Until CSRF protection is added to the API, disallow this method for # Until CSRF protection is added to the API, disallow this method for
# state-changing endpoints # state-changing endpoints
def find_user_from_warden def find_user_from_warden
warden.try(:authenticate) if request.get? || request.head? warden.try(:authenticate) if %w[GET HEAD].include?(env['REQUEST_METHOD'])
end end
   
def find_user_by_private_token def find_user_by_private_token
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