diff --git a/src/wp-includes/rest-api/class-wp-rest-request.php b/src/wp-includes/rest-api/class-wp-rest-request.php
index 9360cca..6b1cbef 100644
|
a
|
b
|
class WP_REST_Request implements ArrayAccess { |
| 286 | 286 | * @param string $key Header name. |
| 287 | 287 | */ |
| 288 | 288 | public function remove_header( $key ) { |
| | 289 | $key = $this->canonicalize_header_name( $key ); |
| 289 | 290 | unset( $this->headers[ $key ] ); |
| 290 | 291 | } |
| 291 | 292 | |
diff --git a/tests/phpunit/tests/rest-api/rest-request.php b/tests/phpunit/tests/rest-api/rest-request.php
index a96bbb0..4187526 100644
|
a
|
b
|
class Tests_REST_Request extends WP_UnitTestCase { |
| 30 | 30 | $this->assertNull( $this->request->get_header( 'missing' ) ); |
| 31 | 31 | $this->assertNull( $this->request->get_header_as_array( 'missing' ) ); |
| 32 | 32 | } |
| | 33 | |
| | 34 | public function test_remove_header() { |
| | 35 | $this->request->add_header( 'Test-Header', 'value' ); |
| | 36 | $this->assertEquals( 'value', $this->request->get_header( 'Test-Header' ) ); |
| | 37 | |
| | 38 | $this->request->remove_header( 'Test-Header' ); |
| | 39 | $this->assertNull( $this->request->get_header( 'Test-Header' ) ); |
| | 40 | } |
| 33 | 41 | |
| 34 | 42 | public function test_header_multiple() { |
| 35 | 43 | $value1 = 'application/x-wp-example-1'; |