You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
dmargery
added a commit
to dmargery/rest-client-components
that referenced
this issue
Jun 27, 2018
When
RestClient::Rack::Compatibility
is disabledRequest.execute
will return a response compatible with RACK spec instead of aRestClient.Response
ObjectMoreover, the
RACK_APP
defined by rest-client-components expects that the call tooriginal_execute
returns aRestClient.Response
However, if the initial response is a redirect (302),
original_execute
will build a new Request and return the result of callingexecute
on it. WithRestClient::Rack::Compatibility
disabled, this result will be a response object conform to the RACK spec, thus breakingRACK_APP
's expectations.Possible fixes:
RACK_APP
could calloriginal_execute
withmax_redirects
set to 0. But this implies that whenRestClient::Rack::Compatibility
is disabled, RestClient users loose automatic handling of redirections.RACK_APPP
could be updated to handle RACK spec results fromoriginal_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
The text was updated successfully, but these errors were encountered: