Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: CGI Redirect with Status

by Ovid (Cardinal)
on Jun 04, 2003 at 20:40 UTC ( #263142=note: print w/ replies, xml ) Need Help??

in reply to CGI Redirect with Status

I've never been quite sure why this is, but hard-codes the redirection value:

sub redirect { my($self,@p) = self_or_default(@_); my($url,$target,$cookie,$nph,@other) = rearrange([[LOCATION,URI,UR +L],TARGET,['COOKIE','COOKIES'],NPH],@p); $url ||= $self->self_url; my(@o); foreach (@other) { tr/\"//d; push(@o,split("=",$_,2)); } unshift(@o, '-Status' => '302 Moved', '-Location'=> $url, '-nph' => $nph); unshift(@o,'-Target'=>$target) if $target; unshift(@o,'-Type'=>''); my @unescaped; unshift(@unescaped,'-Cookie'=>$cookie) if $cookie; return $self->header((map {$self->unescapeHTML($_)} @o),@unescaped +); }

There are various ways to deal with this, none of them completely satisfactory. Perhaps the easiest would be to generate your own redirect header rather than rely on


New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)

Comment on Re: CGI Redirect with Status
Download Code
Replies are listed 'Best First'.
•Re: Re: CGI Redirect with Status
by merlyn (Sage) on Jun 04, 2003 at 23:44 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://263142]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2015-10-09 20:15 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (251 votes), past polls