diff --git a/core/lib/Drupal/Core/Routing/RequestFormatRouteFilter.php b/core/lib/Drupal/Core/Routing/RequestFormatRouteFilter.php
index 8119efa..9ba0ab8 100644
--- a/core/lib/Drupal/Core/Routing/RequestFormatRouteFilter.php
+++ b/core/lib/Drupal/Core/Routing/RequestFormatRouteFilter.php
@@ -38,14 +38,15 @@ public function filter(RouteCollection $collection, Request $request) {
       }
     }
 
-    if (count($collection)) {
-      return $collection;
-    }
-
     // We do not throw a
     // \Symfony\Component\Routing\Exception\ResourceNotFoundException here
-    // because we don't want to return a 404 status code, but rather a 406.
-    throw new NotAcceptableHttpException("No route found for the specified format $format.");
+    // for non html formats because we don't want to return a 404 status code,
+    // but rather a 406.
+    if (!count($collection) && $format !== 'html') {
+      throw new NotAcceptableHttpException("No route found for the specified format $format.");
+    }
+
+    return $collection;
   }
 
 }
