summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2014-05-22 05:36:12 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-05-27 09:59:22 -0700
commitc553fd1c1ef76688b6200e66a825b530b0b02140 (patch)
tree47fa0f751549ddb1944bb5b9908f784bc84b760c /http.c
parentremote-curl: reencode http error messages (diff)
downloadtgif-c553fd1c1ef76688b6200e66a825b530b0b02140.tar.xz
http: default text charset to iso-8859-1
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 */