Changeset 35758
- Timestamp:
- 12/03/2015 04:34:00 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r35741 r35758 781 781 $response = null; 782 782 783 if ( empty( $handler['methods'][ $method ] ) ) { 783 $checked_method = 'HEAD' === $method ? 'GET' : $method; 784 if ( empty( $handler['methods'][ $checked_method ] ) ) { 784 785 continue; 785 786 } -
trunk/tests/phpunit/tests/rest-api/rest-server.php
r35671 r35758 122 122 } 123 123 124 public function test_head_request_handled_by_get() { 125 register_rest_route( 'head-request', '/test', array( 126 'methods' => array( 'GET' ), 127 'callback' => '__return_true', 128 ) ); 129 $request = new WP_REST_Request( 'HEAD', '/head-request/test' ); 130 $response = $this->server->dispatch( $request ); 131 $this->assertEquals( 200, $response->get_status() ); 132 } 133 124 134 /** 125 135 * Pass a capability which the user does not have, this should
Note: See TracChangeset
for help on using the changeset viewer.