]> bicyclesonthemoon.info Git - ott/bsta/blobdiff - bbcode.1.pl
improve HTTP headers; can't post with GET request
[ott/bsta] / bbcode.1.pl
index a478cdc23dd24e58916da4d96bb251d254afa112..ee88ab11ed22efcf07af55f7b1715b6d368e13f6 100644 (file)
@@ -27,11 +27,13 @@ use Encode ('encode', 'decode');
 
 ###PERL_LIB: use lib /botm/lib/bsta
 use botm_common (
+       'HTTP_STATUS',
        'read_header_env',
        'read_data_file',
        'url_query_decode',
        'join_path',
-       'merge_url'
+       'merge_url',
+       'http_header_status'
 );
 use bsta_lib (
        'STATE',
@@ -88,7 +90,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);
@@ -150,7 +152,7 @@ else {
 
 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') {