From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Marius Bakke Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] web: Treat 'application/json' and similar as text. Date: Tue, 5 Sep 2023 14:05:15 +0800 Message-ID: <20230905060515.16287-1-marius@gnu.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38374"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Sep 05 08:05:36 2023 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qdPBw-0009kw-HO for guile-devel@m.gmane-mx.org; Tue, 05 Sep 2023 08:05:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdPBl-0001HT-CR; Tue, 05 Sep 2023 02:05:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdPBj-0001HF-Mv for guile-devel@gnu.org; Tue, 05 Sep 2023 02:05:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdPBj-0004MB-E2 for guile-devel@gnu.org; Tue, 05 Sep 2023 02:05:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=/62JBDSVWMWZ/WtJiTwQdf5LzXJtrQQ8waWgdOC5b64=; b=fdTROK0OiuTEmn QDnWjZYOR5Y8Bcl95t5t1XxsC3JLLZTzDUiDuU6DZPbbzqtxMSVhctznwmj4p09zyz0F9vQbGRbR1 rRSIEPem5TYvG95l/gFrSlnbgMjT3LPMMwnsajLm+y+5RvsFHfyf0tM0yRwjCLS2il4weQS7/atwi iyRkKM+r/IiVidugP0bUPoQyztecWgnSIZqVRf8eOONzJHkYNuRb12ZXqBx0bM6g9hqK1bjciObfs QKJ5u7sO88sZra0xlufRwPT4e97bBcIgpaaIafL0jF1cwjRgdKQqBqrVkVjFnnDnajgLU5qOeXtf8 gZh/qDbK8zzAO1lUr0UQ==; X-Mailer: git-send-email 2.41.0 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21940 Archived-At: * 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