From: Martin Ashby <martin@ashbysoft.com>
To: cgit@lists.zx2c4.com
Cc: Martin Ashby <martin@ashbysoft.com>
Subject: [PATCH] ui-snapshot: Remove charset from content-type header
Date: Mon, 28 Aug 2023 08:39:14 +0100 [thread overview]
Message-ID: <20230828073945.311406-1-martin@ashbysoft.com> (raw)
The charset is only applicable for text type media types, which
snapshots are not. Including the charset in non-text media types also
breaks some client software.
Signed-off-by: Martin Ashby <martin@ashbysoft.com>
---
ui-snapshot.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 18361a6..9eb1ed7 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -169,6 +169,8 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
ctx.page.etag = oid_to_hex(&oid);
ctx.page.mimetype = xstrdup(format->mimetype);
ctx.page.filename = xstrdup(filename);
+ // A charset parameter isn't applicable for binary downloads
+ ctx.page.charset = NULL;
cgit_print_http_headers();
init_archivers();
format->write_func(hex, prefix);
--
2.41.0
reply other threads:[~2023-08-28 7:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230828073945.311406-1-martin@ashbysoft.com \
--to=martin@ashbysoft.com \
--cc=cgit@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).