Fix error generated when requested URL is a non-existing file.
authorChris Hanson <org/chris-hanson/cph>
Thu, 31 Mar 2005 05:24:39 +0000 (05:24 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 31 Mar 2005 05:24:39 +0000 (05:24 +0000)
v7/src/ssp/mod-lisp.scm

index 7584fc4cbaa9fc69270d5d011f328d734b8fceb3..f44a9fc675ca9174da07e6a7cc767a6c0b0e8f74 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: mod-lisp.scm,v 1.27 2005/02/19 04:35:28 cph Exp $
+$Id: mod-lisp.scm,v 1.28 2005/03/31 05:24:39 cph Exp $
 
 Copyright 2003,2004,2005 Massachusetts Institute of Technology
 
@@ -113,7 +113,14 @@ USA.
             (set-content-type-header response default-type)
             (if handler
                 (mod-lisp-expander request response pathname handler)
-                (set-entity response (->pathname pathname))))))
+                (let ((pathname (->pathname pathname)))
+                  (if (file-regular? pathname)
+                      (set-entity response pathname)
+                      (status-response! response
+                                        404
+                                        (list "The document "
+                                              (http-message-url request)
+                                              " can't be found."))))))))
       (receive (handler default-type) (http-message-handler request)
        (if handler
            (expand default-type handler)