Fix case insensitive string comparison for http header names
authorSergio Santoro <santoro.srg@gmail.com>
Sat, 2 Aug 2014 11:29:57 +0000 (13:29 +0200)
committerTim Starling <tstarling@wikimedia.org>
Fri, 12 Dec 2014 02:38:43 +0000 (02:38 +0000)
As of RFC 2616 sec 4.2, http header names are case insensitive.

Change-Id: Ib72df2572f5a9c825c5b3ad7735126f3687aad79

includes/OutputHandler.php

index b0bbcdd..c6209ee 100644 (file)
@@ -129,7 +129,8 @@ function wfGzipHandler( $s ) {
        $headers = headers_list();
        $foundVary = false;
        foreach ( $headers as $header ) {
-               if ( substr( $header, 0, 5 ) == 'Vary:' ) {
+               $headerName = strtolower( substr( $header, 0, 5 ) );
+               if ( $headerName == 'vary:' ) {
                        $foundVary = true;
                        break;
                }