Changeset 37726
- Timestamp:
- 06/16/2016 02:58:28 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r37674 r37726 227 227 $content_type = isset( $_GET['_jsonp'] ) ? 'application/javascript' : 'application/json'; 228 228 $this->send_header( 'Content-Type', $content_type . '; charset=' . get_option( 'blog_charset' ) ); 229 $this->send_header( 'X-Robots-Tag', 'noindex' ); 229 230 230 231 /* -
trunk/tests/phpunit/tests/rest-api/rest-server.php
r37163 r37726 718 718 } 719 719 720 public function test_x_robot_tag_header_on_requests() { 721 $request = new WP_REST_Request( 'GET', '/', array() ); 722 723 $result = $this->server->serve_request('/'); 724 $headers = $this->server->sent_headers; 725 726 $this->assertEquals( 'noindex', $headers['X-Robots-Tag'] ); 727 } 728 720 729 public function test_nocache_headers_on_authenticated_requests() { 721 730 $editor = self::factory()->user->create( array( 'role' => 'editor' ) );
Note: See TracChangeset
for help on using the changeset viewer.