The Lambda Lab
/
projects
/
rags.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2a9ed2e
)
Adds XML mime type, allows all types to generate dynamic content.
author
Tim Vaughan
<plugd@thelambdalab.xyz>
Tue, 26 May 2020 10:11:52 +0000
(12:11 +0200)
committer
Tim Vaughan
<plugd@thelambdalab.xyz>
Tue, 26 May 2020 10:11:52 +0000
(12:11 +0200)
rags.scm
patch
|
blob
|
history
diff --git
a/rags.scm
b/rags.scm
index
69e7ff6
..
1ec9bf7
100644
(file)
--- a/
rags.scm
+++ b/
rags.scm
@@
-19,7
+19,8
@@
(define file-types
'(("gmi" "text/gemini" "charset=utf-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))))
(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
(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)))))
((string-prefix? "text/" mime-type)
(serve-text-plain path))
(else (serve-binary path)))))