From 64dc191a6d010e83ec8fe923aa1c76333254935e Mon Sep 17 00:00:00 2001 From: Uriel Date: Tue, 8 Jul 2008 00:23:00 +0200 Subject: [PATCH] Exit after doing a perm redirect, and some small style fixes --- bin/controller.rc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/controller.rc b/bin/controller.rc index b718d1e..3600723 100755 --- a/bin/controller.rc +++ b/bin/controller.rc @@ -125,7 +125,7 @@ fn genbody { if not if(~ $#blogDirs 0) { #echo 'Status: 404 Not Found\n\n' # should go before starting to print body template.awk inc/404.tpl | rc $rcargs - dprint 'NOT FOUND: '$SERVER_NAME^$REQUEST_URI^' - '^$"HTTP_REFERER + dprint 'NOT FOUND: '$SERVER_NAME^$REQUEST_URI^' - '^$"HTTP_REFERER^' - '^$HTTP_USER_AGENT } if(! ~ $#blogDirs 0) { @@ -147,11 +147,11 @@ fn genbody { . etc/initrc fn dprint { - echo $* >[1=2] + echo $* >[1=2] } if(! ~ $#debug 0) { - echo $SERVER_NAME^'/'^$REQUEST_URI - >[1=2] + echo $SERVER_NAME^'/'^$REQUEST_URI - >[1=2] } if (! ~ $args '') { @@ -178,15 +178,16 @@ for (i in ('' $args)) { } fn perm_redirect { - echo 'Status: 301 Moved Permanantly + echo 'Status: 301 Moved Permanantly Location: '^$1^' ' + exit } # Redirections and other preprocessing if (~ $#redirectPermanent 1) - perm_redirect $"redirectPermanent + perm_redirect $"redirectPermanent if not if (~ $#redirectPermanent 2) { # Experimental regexp sub-based redirect, probably should find a nicer interface