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

CURLOPT_FOLLOWLOCATION is ignored #40

Closed
edwardgalligan opened this Issue Jun 13, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@edwardgalligan
Copy link

edwardgalligan commented Jun 13, 2018

It appears CURLOPT_FOLLOWLOCATION is hardcoded to false here for some strange reason.

Obviously this makes it impossible to directly interact with an entire category of HTTP responses (3xx) in any way with this library.

Was this done intentionally or is it simply an accidental addition? If the latter I can submit a PR to fix.

Note: I realise I'm possibly missing something - is there a way to set this setting at the request stage?

@dbu

This comment has been minimized.

Copy link
Contributor

dbu commented Nov 29, 2018

the Httplug interface (and PSR-18) define that the client must not follow redirects on its own. This client follows the standard, so that consumers of Httplug clients get a consistent interaction when swapping clients.

however, i agree that this is suprising because we allow setting the options. i think we should either respect the wish of a consumer to force this client to not behave according to spec, or validate the $options and throw an error when you try to enable redirections. not sure which is to be preferred... @php-http/owners wdyt?

@joelwurtz

This comment has been minimized.

Copy link
Member

joelwurtz commented Nov 29, 2018

Would go for option 1 here :

respect the wish of a consumer to force this client to not behave according to spec

Respecting the specification is important for libraries exposing client, if you just use it then it does not matter. We should have the same approach than the PluginClient with the RedirectPlugin.

@dbu

This comment has been minimized.

Copy link
Contributor

dbu commented Nov 29, 2018

see #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment