summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2015-06-11 15:56:09 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2015-06-11 15:58:01 -0700
commitc37f91d8192677a50ced23011fa2539e2e1cf2a0 (patch)
treee389dcb129108ebc909c8a32cdd94fd674be9b53
parenta1a4ec0547850f84ea192c530f9e8ac33b379d46 (diff)
downloadgitweb2cgit-c37f91d8192677a50ced23011fa2539e2e1cf2a0.tar.gz
gitweb2cgit-c37f91d8192677a50ced23011fa2539e2e1cf2a0.tar.xz
gitweb2cgit-c37f91d8192677a50ced23011fa2539e2e1cf2a0.zip
Permanent redirect, don't escape slashes
Send a permanent (301) redirect, don't escape slashes in the query string (because why?)
-rwxr-xr-xgitweb2cgit.cgi10
1 files changed, 8 insertions, 2 deletions
diff --git a/gitweb2cgit.cgi b/gitweb2cgit.cgi
index 32e41a8..52905e7 100755
--- a/gitweb2cgit.cgi
+++ b/gitweb2cgit.cgi
@@ -165,5 +165,11 @@ $uri->path( $uri->path . $p . $action . $f );
# Remainder becomes a new query string
$uri->query_form( \%parm, ';' );
-# Redirect to the correspin
-print $cgi_query->redirect($uri);
+# URL as string
+my $us = $uri->as_string;
+
+# Unescape slashes (lot cleaner, and doesn't alter meaning
+$us =~ s/\%2F/\//g;
+
+# Permanent redirect
+print $cgi_query->redirect( -uri => $us, -status => '301 Moved Permanently' );