diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-27 18:09:41 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-27 18:09:41 +0000 |
commit | f569792df8a25caa1bed9c448c8c4c3f837f5164 (patch) | |
tree | 8c2ed7dae5ba132a97c0321a7649174e5832d637 /lib/api/api_guard.rb | |
parent | c2908ec6a0d7b62996cdb8da0350705bdad691bf (diff) | |
download | gitlab-ce-f569792df8a25caa1bed9c448c8c4c3f837f5164.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/api_guard.rb')
-rw-r--r-- | lib/api/api_guard.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb index 9dd2de5c7ba..cb83d22a07f 100644 --- a/lib/api/api_guard.rb +++ b/lib/api/api_guard.rb @@ -148,7 +148,16 @@ module API { scope: e.scopes }) end - response.finish + finished_response = nil + response.finish do |rack_response| + # Grape expects a Rack::Response + # (https://github.com/ruby-grape/grape/commit/c117bff7d22971675f4b34367d3a98bc31c8fc02), + # and we need to retrieve it here: + # https://github.com/nov/rack-oauth2/blob/40c9a99fd80486ccb8de0e4869ae384547c0d703/lib/rack/oauth2/server/abstract/error.rb#L28 + finished_response = rack_response + end + + finished_response end end end |