Check for status codes instead of relying on response.redirect?.

Rack did so much refactoring, we do not see a Response object here anymore.
This commit is contained in:
Dennis Schubert 2020-02-11 22:35:10 +01:00 committed by Benjamin Neff
parent 35da56109f
commit 45e8b54bea
No known key found for this signature in database
GPG key ID: 971464C3F1A90194

View file

@ -104,8 +104,9 @@ module Api
end
def handle_start_point_response(endpoint)
_status, header, response = endpoint.call(request.env)
if response.redirect?
status, header, _response = endpoint.call(request.env)
if status.in?([301, 302, 303, 307, 308])
redirect_to header["Location"]
else
save_params_and_render_consent_form(endpoint)