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

Introduce CURLOPT_POSTREDIR option for missing request body when following 301 redirects #237

Closed

Conversation

Kanabanarama
Copy link

Buzz is following 301 redirects because of CURLOPT_FOLLOWLOCATION, but the request body is missing in the subsequent requests. CURLOPT_FOLLOWLOCATION switches from POST to GET requests, so the POST body is lost due to the default CURLOPT_POSTREDIR setting.

A library I'm using (opensearchserver-php-client) gets a HTTP/1.1 200 OK answer that looks normal but is missing the needed result fields which is inexplicable behaviour.

I made this PR to introduce the CURLOPT_POSTREDIR setting that solves this. Is this ok or should this be configurable by an option?

@Nyholm
Copy link
Collaborator

Nyholm commented Mar 17, 2018

Sorry for the slow response. PSR-18 specifies that redirects should not be followed at all. So this PR is a move in the wrong direction.

@Nyholm Nyholm closed this Mar 17, 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

Successfully merging this pull request may close these issues.

None yet

2 participants