Skip to content

Commit

Permalink
http: default text charset to iso-8859-1
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed May 27, 2014
1 parent fc1b774 commit c553fd1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit c553fd1

Please sign in to comment.