Skip to content

Commit

Permalink
Update SetHeaderMiddleware.php
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-helldar authored Oct 23, 2023
1 parent ac2a925 commit bdf22db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Middlewares/SetHeaderMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ class SetHeaderMiddleware
{
public function handle(Request $request, Closure $next)
{
$response = $next($this->set($request));

return $this->set($response);
return $this->set(
$next($this->set($request))
);
}

protected function set($request)
{
if (! $request->hasHeader(Header::ACCEPT)) {
if (! $request->headers->has(Header::ACCEPT)) {
$request->headers->set(Header::ACCEPT, 'application/json');
}

Expand Down

0 comments on commit bdf22db

Please sign in to comment.