path: root/http.h
diff options
authorShawn Pearce <>2013-01-31 21:02:07 (GMT)
committerJunio C Hamano <>2013-02-04 18:22:36 (GMT)
commit4656bf47fca857df51b5d6f4b7b052192b3b2317 (patch)
tree91e4d6cf951f2964de99d454ec89e426753ac453 /http.h
parente1b6ff44d61bcdd91280c3f7c3c5ace32d4b7c52 (diff)
Verify Content-Type from smart HTTP servers
Before parsing a suspected smart-HTTP response verify the returned Content-Type matches the standard. This protects a client from attempting to process a payload that smells like a smart-HTTP server response. JGit has been doing this check on all responses since the dawn of time. I mistakenly failed to include it in git-core when smart HTTP was introduced. At the time I didn't know how to get the Content-Type from libcurl. I punted, meant to circle back and fix this, and just plain forgot about it. Signed-off-by: Shawn Pearce <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'http.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/http.h b/http.h
index 0a80d30..25d1931 100644
--- a/http.h
+++ b/http.h
@@ -132,7 +132,7 @@ extern char *get_remote_object_url(const char *url, const char *hex,
* If the result pointer is NULL, a HTTP HEAD request is made instead of GET.
-int http_get_strbuf(const char *url, struct strbuf *result, int options);
+int http_get_strbuf(const char *url, struct strbuf *content_type, struct strbuf *result, int options);
* Prints an error message using error() containing url and curl_errorstr,