Add X-Robots-Tag header to Special:Export dumps
authorAndrew H <crazy4sb@gmail.com>
Sun, 24 Apr 2016 17:59:27 +0000 (17:59 +0000)
committerAndrew H <crazy4sb@gmail.com>
Sun, 24 Apr 2016 17:59:27 +0000 (17:59 +0000)
Adds "X-Robots-Tag: noindex,nofollow" header to Special:Export
dumps so that dumps are not indexed by search engines.

Bug: T91363
Change-Id: Ia96ec40ff185fdfd024312ee3cfe3c736ba8d806

includes/specials/SpecialExport.php

index ede367e..3e66ab0 100644 (file)
@@ -168,6 +168,7 @@ class SpecialExport extends SpecialPage {
                        // This should provide safer streaming for pages with history
                        wfResetOutputBuffers();
                        $request->response()->header( "Content-type: application/xml; charset=utf-8" );
+                       $request->response()->header( "X-Robots-Tag: noindex,nofollow" );
 
                        if ( $request->getCheck( 'wpDownload' ) ) {
                                // Provide a sane filename suggestion