[Jifty-commit] r604 -

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Feb 19 23:08:46 EST 2006


Author: jesse
Date: Sun Feb 19 23:08:45 2006
New Revision: 604

Modified:
   /   (props changed)
   jifty/trunk/lib/Jifty/Web.pm

Log:
 r24437 at truegrounds:  jesse | 2006-02-19 20:24:24 -0500
 * Better debug logging.
 * Better checking to make sure we don't try to redirect to //index.html, 
   which browsers treat as "http://index.html" (or https://)


Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm	(original)
+++ jifty/trunk/lib/Jifty/Web.pm	Sun Feb 19 23:08:45 2006
@@ -664,6 +664,9 @@
     my $self = shift;
     my ($page) = @_;
 
+    # $page can't lead with // or it assumes it's a URI scheme.
+    $page =~ s{^/+}{/};
+
     # This is designed to work under CGI or FastCGI; will need an
     # abstraction for mod_perl
 
@@ -672,6 +675,7 @@
 
     my $apache = Jifty->handler->apache;
 
+    $self->log->debug("Redirecting to $page");
     # Headers..
     $apache->header_out( Location => $page );
     $apache->header_out( Status => 302 );


More information about the Jifty-commit mailing list