diff --git a/core/modules/rest/tests/src/Functional/ResourceTestBase.php b/core/modules/rest/tests/src/Functional/ResourceTestBase.php
index 10fa555c1e..0a0e34c35d 100644
--- a/core/modules/rest/tests/src/Functional/ResourceTestBase.php
+++ b/core/modules/rest/tests/src/Functional/ResourceTestBase.php
@@ -351,12 +351,7 @@ protected function request($method, Url $url, array $request_options) {
    */
   protected function assertResourceResponse($expected_status_code, $expected_body, ResponseInterface $response) {
     $this->assertSame($expected_status_code, $response->getStatusCode());
-    if ($expected_status_code < 400) {
-      $this->assertSame([static::$mimeType], $response->getHeader('Content-Type'));
-    }
-    else {
-      $this->assertSame([static::$mimeType], $response->getHeader('Content-Type'));
-    }
+    $this->assertSame([static::$mimeType], $response->getHeader('Content-Type'));
     if ($expected_body !== FALSE) {
       $this->assertSame($expected_body, (string) $response->getBody());
     }
