Match redirect behavior to browser handling.
Changes 302 redirects from POST to GET to match browser handling. Per RFC 7231, user agents can deviate from the strict reading of the specification for compatibility purposes.
$locationstringrequired
$headersarrayrequired
$datastring|arrayrequired
$optionsarrayrequired
$originalWpOrgRequestsResponserequired
public static function browser_redirect_compatibility( $location, $headers, $data, &$options, $original ) {
// Browser compatibility.
if ( 302 === $original->status_code ) {
$options['type'] = WpOrg\Requests\Requests::GET;
}
}
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http/browser_redirect_compatibility