Merge "Do not vary on session cookies when the session is disabled"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 25 Feb 2016 21:56:56 +0000 (21:56 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 25 Feb 2016 21:56:56 +0000 (21:56 +0000)
includes/session/SessionManager.php

index 1aab12a..b1d5d77 100644 (file)
@@ -296,6 +296,9 @@ final class SessionManager implements SessionManagerInterface {
        }
 
        public function getVaryHeaders() {
+               if ( defined( 'MW_NO_SESSION' ) && MW_NO_SESSION !== 'warn' ) {
+                       return [];
+               }
                if ( $this->varyHeaders === null ) {
                        $headers = [];
                        foreach ( $this->getProviders() as $provider ) {
@@ -314,6 +317,9 @@ final class SessionManager implements SessionManagerInterface {
        }
 
        public function getVaryCookies() {
+               if ( defined( 'MW_NO_SESSION' ) && MW_NO_SESSION !== 'warn' ) {
+                       return [];
+               }
                if ( $this->varyCookies === null ) {
                        $cookies = [];
                        foreach ( $this->getProviders() as $provider ) {