Skip to content

Commit

Permalink
Merge pull request #10167 from inietov/bug/sc-17520/symfony_component…
Browse files Browse the repository at this point in the history
…_debug_exception_fatalthrowableerror

Set headers in a different manner in the middleware [sc-17520]
  • Loading branch information
snipe committed Oct 5, 2021
2 parents 84c73aa + ef6eea6 commit 17d4e25
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/Http/Middleware/PreventBackHistory.php
Expand Up @@ -15,9 +15,16 @@ class PreventBackHistory
*/
public function handle($request, Closure $next)
{
$headers = [
'Cache-Control' => 'nocache, no-store, max-age=0, must-revalidate',
'Pragma' => 'no-cache',
'Expires' => 'Sun, 02 Jan 1990 00:00:00 GMT'
];
$response = $next($request);
return $response->header('Cache-Control','no-cache, no-store, max-age=0, must-revalidate')
->header('Pragma','no-cache')
->header('Expires','Sun, 02 Jan 1990 00:00:00 GMT');
foreach($headers as $key => $value) {
$response->headers->set($key, $value);
}

return $response;
}
}

0 comments on commit 17d4e25

Please sign in to comment.