]> bicyclesonthemoon.info Git - ott/bsta/blobdiff - viewer.1.pl
improve GOTO handling
[ott/bsta] / viewer.1.pl
index c7d74d9d4edb1401940671026c30cab5fe9a085f..338eb875d46bcc8420214b172167d35b870ef9df 100644 (file)
@@ -52,6 +52,7 @@ use bsta_lib (
 ###PERL_PATH_SEPARATOR:     PATH_SEPARATOR     = /
 
 ###PERL_CGI_PATH:           CGI_PATH           = /bsta/
+###PERL_CGI_GOTO_PATH:      CGI_GOTO_PATH      = /bsta/g
 ###PERL_CGI_VIEWER_PATH:    CGI_VIEWER_PATH    = /bsta/v
 
 ###PERL_DATA_STATE_PATH:    DATA_STATE_PATH    = /botm/data/bsta/state
@@ -121,6 +122,16 @@ if ($method eq 'POST') {
                exit fail_content_type($method, $http{'content-type'});
        }
 }
+
+if (
+       (defined $cgi{'f'}) &&
+       ($cgi{'f'} eq '') &&
+       ($cgi{'g'} ne '')
+) { # GOTO with no value
+       exit redirect($method, CGI_GOTO_PATH(), HTTP_STATUS->{'see_other'});
+}
+
+
 $no_cgi = (scalar (keys %cgi) == 0);
 
 $IP = get_remote_addr();