aboutsummaryrefslogtreecommitdiff
path: root/module/entry-points/server.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-05-22 23:44:19 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-05-23 12:59:19 +0200
commit3878b00db9b0f1f271d35a118fba04aed5383113 (patch)
tree567d7dcf779e5037b4a73a5e8bb6290012d6bacd /module/entry-points/server.scm
parentRemove (vcomponent output) module. (diff)
downloadcalp-3878b00db9b0f1f271d35a118fba04aed5383113.tar.gz
calp-3878b00db9b0f1f271d35a118fba04aed5383113.tar.xz
Fix javascript mimetype in server.
Diffstat (limited to 'module/entry-points/server.scm')
-rw-r--r--module/entry-points/server.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm
index 604766a5..c671867d 100644
--- a/module/entry-points/server.scm
+++ b/module/entry-points/server.scm
@@ -148,9 +148,15 @@
;; production it isn't a huge problem.
(GET "/static/:*{.*}.:ext" (* ext)
+
+ ;; Actually parsing /etc/mime.types would be better.
+ (define mime
+ (case (string->symbol ext)
+ [(js) "javascript"]
+ [else ext]))
+
(return
- ;; TODO actually check mimetype
- `((content-type ,(string->symbol (string-append "text/" ext))))
+ `((content-type ,(string->symbol (string-append "text/" mime))))
(call-with-input-file (string-append "static/" * "." ext)
read-string)))