X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FStackMiddleware%2FNegotiationMiddleware.php;h=f246cce4624e1bd9d5df10c4ee4f344257ac77c3;hb=refs%2Fheads%2Fd864;hp=e3864610f4f96013abb73064398e1e75a396ce2a;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php b/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php index e3864610f..f246cce46 100644 --- a/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php +++ b/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php @@ -46,7 +46,9 @@ class NegotiationMiddleware implements HttpKernelInterface { } // Determine the request format using the negotiator. - $request->setRequestFormat($this->getContentType($request)); + if ($requested_format = $this->getContentType($request)) { + $request->setRequestFormat($requested_format); + } return $this->app->handle($request, $type, $catch); } @@ -88,8 +90,8 @@ class NegotiationMiddleware implements HttpKernelInterface { return $request->query->get('_format'); } - // Do HTML last so that it always wins. - return 'html'; + // No format was specified in the request. + return NULL; } }