List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] ui-snapshot: Remove charset from content-type header
@ 2023-08-28  7:39 Martin Ashby
  0 siblings, 0 replies; only message in thread
From: Martin Ashby @ 2023-08-28  7:39 UTC (permalink / raw)
  To: cgit; +Cc: Martin Ashby

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-28  7:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-28  7:39 [PATCH] ui-snapshot: Remove charset from content-type header Martin Ashby

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).