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
I had the following exception appearing on a particular request, Requests_Exception: Only HTTP requests are handled
It was not really an issue with the lib itself, but I encountered a site that would redirect with a relative URI not starting with with a "/". (eg: index.php?controller=AdminOrders&token=)
To solve the problem I had to change the test for URL absolutize in Requests.php parse_response functions.
(also had to add $options['type'] = Requests::GET; right after, that site also sent you 302 but expected GET afterward)
It would prolly be possible to just absolutize the url without test or add an option to force it.
An option for the redirect 302/303 behavior would be cool too.
I then tried to implement a hook at "requests.before_redirect_check" to be able to use the library without modifying it directly, but it seems the $return->headers['location'] variable can't be overridden/deleted ? When I try to replace it with another string, it just appends it at the end.
I had to modify the hooking register code so the options var would be passed by reference (to be able to modify it), which is not the case in currently.
I suggest that you pass all var by reference in your hooks to make things easier.
I had the following exception appearing on a particular request, Requests_Exception: Only HTTP requests are handled
It was not really an issue with the lib itself, but I encountered a site that would redirect with a relative URI not starting with with a "/". (eg: index.php?controller=AdminOrders&token=)
To solve the problem I had to change the test for URL absolutize in Requests.php parse_response functions.
if (strpos ($location, '/') === 0 ) {
became
if (strpos ($location, '/') === 0 || strpos ($location, 'http') === false) {
(also had to add
$options['type'] = Requests::GET;
right after, that site also sent you 302 but expected GET afterward)It would prolly be possible to just absolutize the url without test or add an option to force it.
An option for the redirect 302/303 behavior would be cool too.
I then tried to implement a hook at "requests.before_redirect_check" to be able to use the library without modifying it directly, but it seems the $return->headers['location'] variable can't be overridden/deleted ? When I try to replace it with another string, it just appends it at the end.
The first and last dumps return :
index.php?controller=AdminOrders&token=6d791c08516a9299e2e2b3b5e87662fe&submitFilterorder=1
index.php?controller=AdminOrders&token=6d791c08516a9299e2e2b3b5e87662fe&submitFilterorder=1,http://www.xxxxxxx.com/admin0956/index.php?controller=AdminOrders&token=6d791c08516a9299e2e2b3b5e87662fe&submitFilterorder=1
[EDIT]
I managed to make my hook work :
I had to modify the hooking register code so the options var would be passed by reference (to be able to modify it), which is not the case in currently.
I suggest that you pass all var by reference in your hooks to make things easier.
The text was updated successfully, but these errors were encountered: