support m3u playlists
1 files changed, 3 insertions(+), 0 deletions(-)

M wispserve/serve.w
M wispserve/serve.w +3 -0
@@ 457,6 457,8 @@ define : guess-mime-type  path
     cond
         : not mime-type
           . 'application/octet-stream
+        : string-suffix? ".m3u" path
+          . 'application/x-mpegurl
         : equal? mime-type 'video/x-matroska
           . 'video/webm
         else mime-type

          
@@ 718,6 720,7 @@ define* : string-split-string s substr #
 
 define : server-file-download-handler folder-path request body
     define headers : request-headers request
+    pretty-print : and body (utf8->string body)
     let*
         : range-requested : assoc-item headers 'range
           disallow-range : not : or range-requested : assoc-item headers 'accept-language ;; accept-language is typically interactive, so if it is not present, we fall back to providing the whole file in one go. This is just a heuristic, though. There is no good way to detect "will accept Range response, even though it did not request it".