]> bicyclesonthemoon.info Git - ott/bsta/blobdiff - info.1.pl
improve HTTP headers; can't post with GET request
[ott/bsta] / info.1.pl
index d712acb212c0df448e5b4a94bd3832348baee182..fc236682bb1728d7aa8d26517e992c4f51cc74b2 100644 (file)
--- a/info.1.pl
+++ b/info.1.pl
@@ -27,6 +27,8 @@ use Encode ('encode', 'decode');
 
 ###PERL_LIB: use lib /botm/lib/bsta
 use botm_common (
+       'HTTP_STATUS',
+       'http_header_status',
        'read_header_env',
        'read_data_file', 'write_data_file',
        'url_query_decode',
@@ -87,7 +89,7 @@ if ($ENV{'REQUEST_METHOD'} =~ /^(HEAD|GET|POST)$/) {
        $method = $1;
 }
 else{
-       exit fail_method($ENV{'REQUEST_METHOD'}, 'GET, POST, HEAD');
+       exit fail_method($ENV{'REQUEST_METHOD'}, ['GET', 'POST', 'HEAD']);
 }
 
 %http = read_header_env(\%ENV);
@@ -249,7 +251,7 @@ if (
 
 print "Content-type: text/plain; charset=UTF-8\n";
 if (!$access) {
-       print "Status: 403 Forbidden\n";
+       print http_header_status(HTTP_STATUS->{'forbidden'});
 }
 print "\n";
 if($method eq 'HEAD') {