@@ 459,12 459,19 @@ define : guess-mime-type path
. 'application/octet-stream
: string-suffix? ".m3u" path
. 'application/x-mpegurl
+ : and (equal? mime-type 'text/plain) (string-suffix? ".js" path)
+ . 'application/javascript
: equal? mime-type 'video/x-matroska
. 'video/webm
else mime-type
define : content-type mime-type
- ` ,mime-type (charset . "ISO-8859-1")
+ define charset
+ cond
+ : member mime-type '(text/html text/plain application/x-mpegurl)
+ . "utf-8"
+ else "ISO-8859-1"
+ ` ,mime-type (charset . ,charset)
define : hash-and-mime-if-unknown! served-file
define accesspath : and=> (and=> served-file cdr) served-accesspath