mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
fix(redirect): add no-cache headers to prevent browser caching of redirects
This commit is contained in:
parent
986d198aaf
commit
9c45351880
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);
|
$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
|
// Behave as per HTTP/1.1 spec for others
|
||||||
header('Location: ' . $redirect_url, response_code: 301);
|
header('Location: ' . $redirect_url, response_code: 301);
|
||||||
exit;
|
exit;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue