Add Timing-Allow-Origin header for cross-domain API responses
authorGergő Tisza <tgr.huwiki@gmail.com>
Sun, 11 Jan 2015 07:55:40 +0000 (23:55 -0800)
committerGergő Tisza <tgr.huwiki@gmail.com>
Tue, 13 Jan 2015 23:32:33 +0000 (23:32 +0000)
This makes it possible to get detailed network timing information
via ResourceTiming.

Change-Id: Ie88d4354285420014c0f1612446ba94fc2a8c68f

includes/api/ApiMain.php

index 82ed295..9a98054 100644 (file)
@@ -554,6 +554,7 @@ class ApiMain extends ApiBase {
 
                        $response->header( "Access-Control-Allow-Origin: $originHeader" );
                        $response->header( 'Access-Control-Allow-Credentials: true' );
+                       $response->header( "Timing-Allow-Origin: $originHeader" ); # http://www.w3.org/TR/resource-timing/#timing-allow-origin
 
                        if ( !$preflight ) {
                                $response->header( 'Access-Control-Expose-Headers: MediaWiki-API-Error, Retry-After, X-Database-Lag' );