By berdir on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Introduced in version:
8.0-alpha2-dev
Issue links:
Description:
The Guzzle library has been updated to version 3.7.
One of the relevant changes is how the final location is accessed after a redirect.
Before
// Update the feed URL in case of a 301 redirect.
if ($previous_response = $response->getPreviousResponse()) {
if ($previous_response->getStatusCode() == 301 && $location = $previous_response->getLocation()) {
$feed->url->value = $location;
}
}
After
// Update the feed URL in case of a 301 redirect.
if ($response->getEffectiveUrl() != $feed->url->value) {
$feed->url->value = $response->getEffectiveUrl();
}
Another example, when using Last-Modified or similar headers in the Request, the response now needs to be checked for a HTTP 304 Not Modified explicitly and handled accordingly.
// Given code like this.
$request->addHeader('If-None-Match', $feed->etag->value);
$request->addHeader('If-Modified-Since', gmdate(DATE_RFC1123, $feed->modified->value));
// The status code now needs to be checked for 304 and handled.
if ($response->getStatusCode() == 304) {
return FALSE;
}
See the the official upgrading documentation for all changes: UPGRADING.md
Impacts:
Module developers