Http: Set an error for invalid content-type

This commit is contained in:
Philip Kelley 2012-11-01 12:07:42 -04:00
parent e068f2bb71
commit ff830366ea

View File

@ -170,8 +170,10 @@ static int on_headers_complete(http_parser *parser)
if (git_buf_oom(buf)) if (git_buf_oom(buf))
return t->parse_error = -1; return t->parse_error = -1;
if (strcmp(t->content_type, git_buf_cstr(buf))) if (strcmp(t->content_type, git_buf_cstr(buf))) {
giterr_set(GITERR_NET, "Invalid content-type: %s", t->content_type);
return t->parse_error = -1; return t->parse_error = -1;
}
git_buf_clear(buf); git_buf_clear(buf);
return 0; return 0;