By default the Browser object follows HTTP redirect codes.
However, it seems that when doing so, any custom headers that were used on the initial request are not re-used when following the redirect. Not sure whether this should be default HTTP behaviour (but I think so?)
I suppose re-using the headers should be done here https://github.com/clue/php-buzz-react/blob/ba4eb355e9ffe4bb2a9071ccc69698d48da548dc/src/Io/Transaction.php#L136
Not sure, but maybe something like:
$request = $this->messageFactory->request($method, $location, $request->getHeaders());
The reason how I found out: we use custom headers to simulate the "Google Bot" by using a UserAgent header like Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
After a redirect, the default UserAgent seems to be used: React/alpha defined at https://github.com/reactphp/http-client/blob/d779a3b3c91ee19742839df7395b366da4471d12/src/RequestData.php#L29
By default the Browser object follows HTTP redirect codes.
However, it seems that when doing so, any custom headers that were used on the initial request are not re-used when following the redirect. Not sure whether this should be default HTTP behaviour (but I think so?)
I suppose re-using the headers should be done here https://github.com/clue/php-buzz-react/blob/ba4eb355e9ffe4bb2a9071ccc69698d48da548dc/src/Io/Transaction.php#L136
Not sure, but maybe something like:
The reason how I found out: we use custom headers to simulate the "Google Bot" by using a UserAgent header like
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)After a redirect, the default UserAgent seems to be used:
React/alphadefined at https://github.com/reactphp/http-client/blob/d779a3b3c91ee19742839df7395b366da4471d12/src/RequestData.php#L29