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.

Built from https://develop.svn.wordpress.org/trunk@40577


git-svn-id: http://core.svn.wordpress.org/trunk@40447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Joe Hoyle 2017-05-07 04:09:41 +00:00
parent 7fd55738be
commit b0a327cf3c
2 changed files with 2 additions and 1 deletions

View File

@ -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 ] );
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-40576';
$wp_version = '4.8-alpha-40577';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.