Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When RestClient::Rack::Compatibility is disabled, RestClient looses the ability to follow redirects #17

Open
dmargery opened this issue Jun 27, 2018 · 0 comments

Comments

@dmargery
Copy link

When RestClient::Rack::Compatibility is disabled Request.execute will return a response compatible with RACK spec instead of a RestClient.Response Object

Moreover, the RACK_APP defined by rest-client-components expects that the call tooriginal_execute returns a RestClient.Response

However, if the initial response is a redirect (302), original_execute will build a new Request and return the result of calling execute on it. With RestClient::Rack::Compatibility disabled, this result will be a response object conform to the RACK spec, thus breaking RACK_APP's expectations.

Possible fixes:

  • RACK_APP could call original_execute with max_redirects set to 0. But this implies that when RestClient::Rack::Compatibility is disabled, RestClient users loose automatic handling of redirections.
  • RACK_APPP could be updated to handle RACK spec results from original_execute

If I can setup a development environment for rest-client-components quickly, I'll attempt to write the proper unit test to exhibit this issue

dmargery added a commit to dmargery/rest-client-components that referenced this issue Jun 27, 2018
dmargery added a commit to dmargery/rest-client-components that referenced this issue Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant