Skip to content

Commit

Permalink
Default Content-Type header added to Response
Browse files Browse the repository at this point in the history
  • Loading branch information
reinvanoyen authored May 4, 2020
1 parent 79cfba8 commit a6b29be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Http/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ public function dispatch(ServerRequestInterface $request): ResponseInterface

foreach ($routes as $route) {
if ($route->matches($path)) {
return $route->execute($this->app, $request, $this->responseFactory->createResponse(200));
return $route->execute($this->app, $request, $this->responseFactory->createResponse(200)
->withHeader('Content-Type', 'text/html')
);
}
}

return $this->responseFactory->createResponse(404);
}
}
}

0 comments on commit a6b29be

Please sign in to comment.