diff --git a/scheme/httpd/cgi-server.scm b/scheme/httpd/cgi-server.scm index 8c43de5..825b68c 100644 --- a/scheme/httpd/cgi-server.scm +++ b/scheme/httpd/cgi-server.scm @@ -104,7 +104,7 @@ ; why did we had (string-suffix? "-nph" prog) here? (search (http-url-query (request-url req))) ; Compute the - + (argv (if (and search (not (string-index search #\=))) ; argv list. (split-and-decode-search-spec search) '())) @@ -144,9 +144,9 @@ (define (split-and-decode-search-spec s) (let recur ((i 0)) (cond - ((string-index s #\+ i) => (lambda (j) (cons (unescape-uri s i j) + ((string-index s #\+ i) => (lambda (j) (cons (unescape s i j) (recur (+ j 1))))) - (else (list (unescape-uri s i (string-length s))))))) + (else (list (unescape s i (string-length s))))))) ;;; Compute the CGI scripts' process environment by adding the standard CGI @@ -287,9 +287,7 @@ (copy-inport->outport script-port out))))) (define (uri-has-protocol? loc) - (receive (host port path query) - (parse-url loc) - (if host #t #f))) + (if (http-url-host (url-string->http-url loc)) #t #f)) (define (extract-status-code-and-text status req) (with-fatal-error-handler*