# HG changeset patch # User Arne Babenhauserheide # Date 1617534663 -7200 # Sun Apr 04 13:11:03 2021 +0200 # Node ID b6063cb779a632b6bcf8bcb65621f7ee8d42723b # Parent 9a0ac1b02b67a004da899630a292dc728b4a4da1 support javascript mime types diff --git a/wispserve/serve.w b/wispserve/serve.w --- a/wispserve/serve.w +++ b/wispserve/serve.w @@ -459,12 +459,19 @@ . '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