Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / StackMiddleware / NegotiationMiddleware.php
index e3864610f4f96013abb73064398e1e75a396ce2a..f246cce4624e1bd9d5df10c4ee4f344257ac77c3 100644 (file)
@@ -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;
   }
 
 }