summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-05-22 05:36:12 -0400
committerJunio C Hamano <gitster@pobox.com>2014-05-27 09:59:22 -0700
commitc553fd1c1ef76688b6200e66a825b530b0b02140 (patch)
tree47fa0f751549ddb1944bb5b9908f784bc84b760c /http.c
parentfc1b774c72990f0ff92370316412b19fd72baa77 (diff)
downloadgit-c553fd1c1ef76688b6200e66a825b530b0b02140.tar.gz
http: default text charset to iso-8859-1jk/http-errors
This is specified by RFC 2616 as the default if no "charset" parameter is given. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.c')
-rw-r--r--http.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/http.c b/http.c
index 84463dff3d..2b4f6a357c 100644
--- a/http.c
+++ b/http.c
@@ -978,6 +978,9 @@ static void extract_content_type(struct strbuf *raw, struct strbuf *type,
while (*p && !isspace(*p))
p++;
}
+
+ if (!charset->len && starts_with(type->buf, "text/"))
+ strbuf_addstr(charset, "ISO-8859-1");
}
/* http_request() targets */