* [PATCH] web: Treat 'application/json' and similar as text.
@ 2023-09-05 6:05 Marius Bakke
0 siblings, 0 replies; only message in thread
From: Marius Bakke @ 2023-09-05 6:05 UTC (permalink / raw)
To: guile-devel
* module/web/response.scm (text-content-type?): Add check for /json and +json.
---
module/web/response.scm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/module/web/response.scm b/module/web/response.scm
index 4ac4d74ca..394aac83c 100644
--- a/module/web/response.scm
+++ b/module/web/response.scm
@@ -182,6 +182,8 @@ reason phrase for the response's code."
represents a textual type such as `text/plain'."
(let ((type (symbol->string type)))
(or (string-prefix? "text/" type)
+ (string-suffix? "/json" type)
+ (string-suffix? "+json" type)
(string-suffix? "/xml" type)
(string-suffix? "+xml" type))))
--
2.41.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-09-05 6:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-05 6:05 [PATCH] web: Treat 'application/json' and similar as text Marius Bakke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).