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.
This commit is contained in:
Nick Thomas 2016-09-30 12:21:05 +01:00
parent 9802d3883f
commit 86c0c0869d

View file

@ -25,7 +25,7 @@ module API
# Until CSRF protection is added to the API, disallow this method for
# state-changing endpoints
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
def find_user_by_private_token