Skip to content

Commit c553fd1

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fc1b774 commit c553fd1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

http.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,9 @@ static void extract_content_type(struct strbuf *raw, struct strbuf *type,
978978
while (*p && !isspace(*p))
979979
p++;
980980
}
981+
982+
if (!charset->len && starts_with(type->buf, "text/"))
983+
strbuf_addstr(charset, "ISO-8859-1");
981984
}
982985

983986
/* http_request() targets */

0 commit comments

Comments
 (0)