Versions of Backdrop prior to 1.27.2 were treating HTTP 429 response codes generically as a 400 response when using backdrop_http_request()
. It is now possible to explicitly distinguish 429 responses, instead of falling back to their "base" response code 400.
Versions prior to 1.27.2:
$response = backdrop_http_request('http://example.com/api/request'); if ($response->code == 400) { // Handle Bad Request errors as well as Too Many Request errors. }
After 1.27.2:
$response = backdrop_http_request('http://example.com/api/request'); if ($response->code == 429) { // Handle Too Many Request errors. } elseif ($response->code == 400) { // Handle Bad Request errors. }
Introduced in branch:
1.x
Introduced in version:
1.27.2
Impacts:
Module developers
Related Github Issues: