diff --git a/core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php b/core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php index d2cce4c..1994f76 100644 --- a/core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php @@ -25,16 +25,20 @@ public static function getLabel() { */ public function getContext($query_arg = NULL) { if ($query_arg === NULL) { + // All arguments requested. Use normalized query string to minimize + // variations. $value = $this->requestStack->getCurrentRequest()->getQueryString(); return ($value !== NULL) ? $value : ''; } - elseif ($this->requestStack->getCurrentRequest()->query->has($query_arg)) { + if ($this->requestStack->getCurrentRequest()->query->has($query_arg)) { + // Requested header exists in request. $value = $this->requestStack->getCurrentRequest()->query->get($query_arg); if ($value !== '') { return $value; } return '?valueless?'; } + // No header in request. return ''; }