From: Tim Vaughan Date: Tue, 26 May 2020 10:11:52 +0000 (+0200) Subject: Adds XML mime type, allows all types to generate dynamic content. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=fd37c59f02d3f282ed288c162428c53e4d156e67;p=rags.git Adds XML mime type, allows all types to generate dynamic content. --- diff --git a/rags.scm b/rags.scm index 69e7ff6..1ec9bf7 100644 --- a/rags.scm +++ b/rags.scm @@ -19,7 +19,8 @@ (define file-types '(("gmi" "text/gemini" "charset=utf-8") - ("txt" "text/plain" "charset=utf-8"))) + ("txt" "text/plain" "charset=utf-8") + ("xml" "text/xml" "charset=utf-8"))) (define (process-request config request-line) (let ((uri (uri-normalize-path-segments (absolute-uri request-line)))) @@ -58,9 +59,8 @@ (mime-type (cadr mime))) (print "20 " (string-intersperse (cdr mime) ";") "\r") (cond - ((and (equal? mime-type "text/gemini") - (file-executable? path)) - (serve-text-dynamic path)) + ((file-executable? path) + (serve-text-dynamic path)) ; Binary-files can also be generated here, but the source is dynamic text ((string-prefix? "text/" mime-type) (serve-text-plain path)) (else (serve-binary path)))))