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:
parent
9802d3883f
commit
86c0c0869d
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue