Ticket #35580: 35580.2.diff
| File 35580.2.diff, 1.5 KB (added by , 10 years ago) |
|---|
-
src/wp-includes/rest-api/class-wp-rest-server.php
228 228 $this->send_header( 'Content-Type', $content_type . '; charset=' . get_option( 'blog_charset' ) ); 229 229 $this->send_header( 'X-Robots-Tag', 'noindex' ); 230 230 231 $api_root = get_rest_url(); 232 if ( ! empty( $api_root ) ) { 233 $this->send_header( 'Link', '<' . esc_url_raw( $api_root ) . '>; rel="https://api.w.org/"' ); 234 } 235 231 236 /* 232 237 * Mitigate possible JSONP Flash attacks. 233 238 * -
tests/phpunit/tests/rest-api/rest-server.php
726 726 $this->assertEquals( 'noindex', $headers['X-Robots-Tag'] ); 727 727 } 728 728 729 public function test_link_header_on_requests() { 730 $api_root = get_rest_url(); 731 732 $request = new WP_REST_Request( 'GET', '/', array() ); 733 734 $result = $this->server->serve_request('/'); 735 $headers = $this->server->sent_headers; 736 737 $this->assertEquals( '<' . esc_url_raw( $api_root ) . '>; rel="https://api.w.org/"', $headers['Link'] ); 738 } 739 729 740 public function test_nocache_headers_on_authenticated_requests() { 730 741 $editor = self::factory()->user->create( array( 'role' => 'editor' ) ); 731 742 $request = new WP_REST_Request( 'GET', '/', array() );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)