mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
fix(redirect): add no-cache headers to prevent browser caching of redirects (#2010)
This commit is contained in:
parent
986d198aaf
commit
134b3dfa5c
1 changed files with 3 additions and 0 deletions
|
@ -1450,6 +1450,9 @@ function redirect($url)
|
|||
|
||||
$redirect_url = $server_protocol . $server_name . $server_port . $script_name . preg_replace('#^\/?(.*?)\/?$#', '/\1', $url);
|
||||
|
||||
// Send no-cache headers to prevent browsers from caching redirects
|
||||
send_no_cache_headers();
|
||||
|
||||
// Behave as per HTTP/1.1 spec for others
|
||||
header('Location: ' . $redirect_url, response_code: 301);
|
||||
exit;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue