Skip to content

Commit

Permalink
Urgent Fix for issue Content Type not specified (#31533)
Browse files Browse the repository at this point in the history
This fixes issue #31518 where Laravel isn't setting a Content-Type and so Symfony is just setting it to whatever the request is asking for.  This is poisoning our cache, serving up our website HTML pages as "XML".
  • Loading branch information
adam1010 authored Feb 20, 2020
1 parent f2d74f4 commit 3f185c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ public static function toResponse($request, $response)
is_array($response))) {
$response = new JsonResponse($response);
} elseif (! $response instanceof SymfonyResponse) {
$response = new Response($response);
$response = new Response($response, 200, ['Content-Type' => 'text/html']);
}

if ($response->getStatusCode() === Response::HTTP_NOT_MODIFIED) {
Expand Down

0 comments on commit 3f185c7

Please sign in to comment.