diff options
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 |