summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kelley <phkelley@hotmail.com>2012-11-01 12:07:42 -0400
committerPhilip Kelley <phkelley@hotmail.com>2012-11-01 12:07:42 -0400
commitff830366ea611c9285a23432edebc16ff6a3d436 (patch)
tree0efa2df6f8a5cd5fbf1a0cf1851e6d207dad646b
parente068f2bb71c647c19713fd9fb53596c7eeddc777 (diff)
downloadlibgit2-ff830366ea611c9285a23432edebc16ff6a3d436.tar.gz
Http: Set an error for invalid content-type
-rw-r--r--src/transports/http.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/transports/http.c b/src/transports/http.c
index 1d0bbd64e..f33cad7ea 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -170,8 +170,10 @@ static int on_headers_complete(http_parser *parser)
if (git_buf_oom(buf))
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;
+ }
git_buf_clear(buf);
return 0;