mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
REST API: WP_REST_Request::remove_header() should canonicalize header names.
When headers are stored in WP_REST_Request internally they are canonicalized. This step already happens on setting / getting headers in any way, but was missed when implementing remove_header(). Props TimothyBlynJacobs. Fixes #40347. git-svn-id: https://develop.svn.wordpress.org/trunk@40577 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -286,6 +286,7 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* @param string $key Header name.
|
||||
*/
|
||||
public function remove_header( $key ) {
|
||||
$key = $this->canonicalize_header_name( $key );
|
||||
unset( $this->headers[ $key ] );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user