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>
maint
Jeff King 2014-05-22 05:36:12 -04:00 committed by Junio C Hamano
parent fc1b774c72
commit c553fd1c1e
1 changed files with 3 additions and 0 deletions

3
http.c
View File

@ -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 */