From a69c9fb665459e2bfdbda1bf80741a0af31a7faf Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:06:40 -0800 Subject: New upstream version 3b5 --- http-cgi.scm | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) mode change 100644 => 100755 http-cgi.scm (limited to 'http-cgi.scm') diff --git a/http-cgi.scm b/http-cgi.scm old mode 100644 new mode 100755 index bc328cf..a6fd493 --- a/http-cgi.scm +++ b/http-cgi.scm @@ -125,7 +125,7 @@ *http:byline* (sprintf #f - "SLIB %s server" + "SLIB %s server" (if (getenv "SERVER_PROTOCOL") "CGI/1.0" "HTTP/1.0")))) (string-append (http:status-line status-code reason-phrase) (http:content @@ -157,9 +157,13 @@ ;;and @var{header-alist}. Otherwise, @0 calls @1 with the ;;@var{request-line}, #f, and @var{header-alist}. ;; -;;If @1 returns a string, it is sent to @3. If @1 returns a list, -;;then an error page with number 525 and strings from the list. If @1 -;;returns #f, then a @samp{Bad Request} (400) page is sent to @3. +;;If @1 returns a string, it is sent to @3. If @1 returns a list +;;whose first element is an integer, then an error page with the +;;status integer which is the first element of the list and strings +;;from the list. If @1 returns a list whose first element isn't an +;;number, then an error page with the status code 500 and strings from +;;the list. If @1 returns #f, then a @samp{Bad Request} (400) page is +;;sent to @3. ;; ;;Otherwise, @0 replies (to @3) with appropriate HTML describing the ;;problem. @@ -185,7 +189,7 @@ ((and (pair? reply) (list? reply)) (if (number? (car reply)) (apply http:error-page reply) - (apply http:error-page 525 reply))) + (apply http:error-page (cons 500 reply)))) (else (http:error-page 500 "Internal Server Error"))))) ((not query-string) (http:error-page 400 "Bad Request" (html:plain request-line))) @@ -325,12 +329,15 @@ ;;Otherwise, @0 calls @1 with the @var{request-line}, #f, and ;;@var{header-alist}. ;; -;;If @1 returns a string, it is sent to @code{(current-input-port)}. -;;If @1 returns a list, then an error page with number 525 and strings -;;from the list. If @1 returns #f, then a @samp{Bad Request} (400) -;;page is sent to @code{(current-input-port)}. +;;If @1 returns a string, it is sent to @code{(current-ouput-port)}. +;;If @1 returns a list whose first element is an integer, then an +;;error page with the status integer which is the first element of the +;;list and strings from the list. If @1 returns a list whose first +;;element isn't an number, then an error page with the status code 500 +;;and strings from the list. If @1 returns #f, then a @samp{Bad +;;Request} (400) page is sent to @code{(current-ouput-port)}. ;; -;;Otherwise, @0 replies (to @code{(current-input-port)}) with +;;Otherwise, @0 replies (to @code{(current-output-port)}) with ;;appropriate HTML describing the problem. (define (cgi:serve-query serve-proc) (let* ((script-name (getenv "SCRIPT_NAME")) -- cgit v1.2.3