diff --git a/scheme/httpd/cgi-server.scm b/scheme/httpd/cgi-server.scm index 045f08d..b3985b2 100644 --- a/scheme/httpd/cgi-server.scm +++ b/scheme/httpd/cgi-server.scm @@ -128,7 +128,15 @@ (format #f "Could not execute CGI script ~a." filename)) stat)) ;; FIXME! must return http-response object! - (cgi-make-response (run/port* doit) req))) + (case (file-not-executable? filename) + ((search-denied permission) + (make-http-error-response http-status/forbidden req + "Permission denied.")) + ((no-directory nonexistent) + (make-http-error-response http-status/not-found req + "File or directory doesn't exist.")) + (else + (cgi-make-response (run/port* doit) req))))) (else (make-http-error-response http-status/method-not-allowed req))))))