diff options
author | Nick Thomas <nick@gitlab.com> | 2016-09-30 12:21:05 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-10-06 15:07:25 +0100 |
commit | 86c0c0869dd4b9de301822a7d598bc4528604e5a (patch) | |
tree | 3669bb3ee240b86848f0712c2cca492ad1280638 /lib | |
parent | 9802d3883fb42dd31f91d71018ac87ba0c32d1c1 (diff) | |
download | gitlab-ce-86c0c0869dd4b9de301822a7d598bc4528604e5a.tar.gz |
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 |