summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-07-08 16:11:08 +0530
committerArun Isaac2022-07-08 16:12:08 +0530
commit20853b93fc679c455d1dab0963b59557f30360c6 (patch)
tree88e4ded14770a22de90a16839e0f17fa35a396a4
parentff61a6cdd67e57358cca8efa4292949ea0c2398d (diff)
downloadtissue-20853b93fc679c455d1dab0963b59557f30360c6.tar.gz
tissue-20853b93fc679c455d1dab0963b59557f30360c6.tar.lz
tissue-20853b93fc679c455d1dab0963b59557f30360c6.zip
web: server: Serve html files even without the html extension.
* tissue/web/server.scm (handler): Serve html files even if they don't have the html extension.
-rw-r--r--tissue/web/server.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/tissue/web/server.scm b/tissue/web/server.scm
index b5338b0..6b6f088 100644
--- a/tissue/web/server.scm
+++ b/tissue/web/server.scm
@@ -228,8 +228,12 @@ STATE-DIRECTORY."
(MSet-get-matches-estimated mset)
(assq-ref host-parameters 'css)))))))))
;; Static files
- ((let ((file-path (string-append state-directory "/" hostname "/website" path)))
- (and (file-exists? file-path)
+ ((let ((file-path
+ (find file-exists?
+ ;; Try path and path.html.
+ (list (string-append state-directory "/" hostname "/website" path)
+ (string-append state-directory "/" hostname "/website" path ".html")))))
+ (and file-path
;; Check that the file really is within the document
;; root.
(string-prefix? (string-append state-directory "/" hostname "/website/")