From 384515a594f0a0e0351245470f3c9abc50bf1b00 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 27 Feb 2024 11:00:42 -0500 Subject: [PATCH] dir: handle html --- src/unix/dir.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unix/dir.ml b/src/unix/dir.ml index f29e9db5..0035849c 100644 --- a/src/unix/dir.ml +++ b/src/unix/dir.ml @@ -310,7 +310,10 @@ let add_vfs_ ~on_fs ~top ~config ~vfs:((module VFS : VFS) as vfs) ~prefix server ) else ( try let mime_type = - if Filename.extension path = ".css" then + (* FIXME: handle .html specially *) + if Filename.extension path = ".html" then + [ "Content-Type", "text/html" ] + else if Filename.extension path = ".css" then [ "Content-Type", "text/css" ] else if Filename.extension path = ".js" then [ "Content-Type", "text/javascript" ]