Return Oauth headers even if none scope was matched

If an endpoint specifies more than one scope and none of the scopes from
access token matches, return oauth headers for the first of the scopes
This commit is contained in:
Piotr Sarnacki 2013-05-08 13:21:46 +02:00
parent cdabec540d
commit d276cd5b32

View File

@ -46,6 +46,9 @@ class Travis::Api::App
end
if !result
headers['X-OAuth-Scopes'] = scopes.map(&:to_s).join(',')
headers['X-Accepted-OAuth-Scopes'] = names.first.to_s
if env['travis.access_token']
pass { halt 403, "insufficient access" }
else