Skip to content

Commit c87ad5d

Browse files
committed
prevent proxies from caching walls
1 parent e51ef90 commit c87ad5d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/StandAloneBounce.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,15 @@ public function sendResponse(?string $body, int $statusCode = 200): void
335335
break;
336336
case 401:
337337
header('HTTP/1.0 401 Unauthorized');
338+
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
339+
header('Cache-Control: post-check=0, pre-check=0', false);
340+
header('Pragma: no-cache');
338341
break;
339342
case 403:
340343
header('HTTP/1.0 403 Forbidden');
344+
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
345+
header('Cache-Control: post-check=0, pre-check=0', false);
346+
header('Pragma: no-cache');
341347
break;
342348
default:
343349
throw new Exception("Unhandled code ${statusCode}");

0 commit comments

Comments
 (0)