opensearchserver-php-client icon indicating copy to clipboard operation
opensearchserver-php-client copied to clipboard

Missing fields in response when Buzz follows 301 redirect

Open Kanabanarama opened this issue 8 years ago • 0 comments

I came across the problem that the fields are missing in a search response when using a http url of a host that redirects to https. In this case the documents in the answer look normal like this:

"documents":[{"pos":0,"score":1.0,"collapseCount":0},{"pos" [...]

but the "fields" attribute is missing.

This is due to Buzz following the redirect 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.

I made a PR in the Buzz repo that addresses this issue.

Kanabanarama avatar Sep 13 '17 13:09 Kanabanarama