Tom Robinson <tom / alkali.spamfree.org> wrote in message news:<aka9nu0ie49m1hob6h9oohlp7isdrqe4m9 / 4ax.com>...
> in perl, this is easy:
> 
> my $cgi = new CGI;
> print $cgi->redirect("http://foo.bar.baz/");'
> 
> gives:
> Status: 302 Moved
> location: http://foo.bar.baz/

<selfpromotion>
NARF should.
http://narf-lib.sourceforge.net
http://www.sourceforge.net/projects/narf-lib
</selfpromotion>

require 'narf'
output = ""
CGI.process( :out => output){ |cgi|
    cgi.set_redirect( "new_location.com" )
}
puts output

# this script outputs:
Content-Type: text/html
Location: new_location.com
Status: 302
Set-Cookie: _session_id=545508609cdfcd19; path=


hmmmmm is this correct?  Narf automagically creates sessions for you,
that's what the Set-Cookie is for.  But is the content-type header
harmful?  What about a status of "302" rather than "302 Moved"?

Let me know so I can fix the behavior!

Thanks,

Patrick May