http: default text charset to iso-8859-1
authorJeff King <peff@peff.net>
Thu, 22 May 2014 09:36:12 +0000 (05:36 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 May 2014 16:59:22 +0000 (09:59 -0700)
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>
http.c
diff --git a/http.c b/http.c
index 84463dff3dc3c350abdc1cc1335a5fdddff5a1fe..2b4f6a357c39f3685107da3cf63a9891470a6de9 100644 (file)
--- 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 */