Match redirect behaviour 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.
(string) (Required) URL to redirect to.
(array) (Required) Headers for the redirect.
(string|array) (Required) Body to send with the request.
(array) (Required) Redirect request options.
(Requests_Response) (Required) Response object.
File: wp-includes/class-http.php
public static function browser_redirect_compatibility( $location, $headers, $data, &$options, $original ) { // Browser compatibility. if ( 302 === $original->status_code ) { $options['type'] = Requests::GET; } }
Version | Description |
---|---|
4.6.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http/browser_redirect_compatibility