Changeset 37903
- Timestamp:
- 06/29/2016 01:56:32 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r37726 r37903 228 228 $this->send_header( 'Content-Type', $content_type . '; charset=' . get_option( 'blog_charset' ) ); 229 229 $this->send_header( 'X-Robots-Tag', 'noindex' ); 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 } 230 235 231 236 /* -
trunk/tests/phpunit/tests/rest-api/rest-server.php
r37726 r37903 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' ) );
Note: See TracChangeset
for help on using the changeset viewer.