diff options
author | Nick Thomas <nick@gitlab.com> | 2016-09-30 14:21:05 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-10-06 17:07:25 +0300 |
commit | 86c0c0869dd4b9de301822a7d598bc4528604e5a (patch) | |
tree | 3669bb3ee240b86848f0712c2cca492ad1280638 /lib | |
parent | 9802d3883fb42dd31f91d71018ac87ba0c32d1c1 (diff) |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/helpers.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 8b8c4eb4d46..281a8f13531 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -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 |