FU: Preserve existing headers on fu->redirect()
Allows setting custom headers (in particular, cookies) when redirecting. This behavior is consistent with send_file().
This commit is contained in:
parent
6787f32fd9
commit
52c36e0aea
1 changed files with 0 additions and 1 deletions
1
FU.pm
1
FU.pm
|
|
@ -862,7 +862,6 @@ sub send_file($, $root, $path) {
|
||||||
|
|
||||||
sub redirect($, $code, $location) {
|
sub redirect($, $code, $location) {
|
||||||
state $alias = {qw/ perm 301 temp 302 tempget 303 tempsame 307 permsame 308 /};
|
state $alias = {qw/ perm 301 temp 302 tempget 303 tempsame 307 permsame 308 /};
|
||||||
fu->reset;
|
|
||||||
fu->status($alias->{$code} // $code);
|
fu->status($alias->{$code} // $code);
|
||||||
fu->set_header(location => "$location");
|
fu->set_header(location => "$location");
|
||||||
fu->set_header('content-type', 'text/plain');
|
fu->set_header('content-type', 'text/plain');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue