summaryrefslogtreecommitdiff
path: root/http.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-05-22 09:30:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-05-27 16:59:19 (GMT)
commite31316263af98c4583be39b469f3152a23eba91d (patch)
tree2bab83853f1a2dbb953689da98fe6cd218b72fb8 /http.h
parentbf197fd7eebcb3579dd659af35822ce88adc66c8 (diff)
downloadgit-e31316263af98c4583be39b469f3152a23eba91d.zip
git-e31316263af98c4583be39b469f3152a23eba91d.tar.gz
git-e31316263af98c4583be39b469f3152a23eba91d.tar.bz2
http: optionally extract charset parameter from content-type
Since the previous commit, we now give a sanitized, shortened version of the content-type header to any callers who ask for it. This patch adds back a way for them to cleanly access specific parameters to the type. We could easily extract all parameters and make them available via a string_list, but: 1. That complicates the interface and memory management. 2. In practice, no planned callers care about anything except the charset. This patch therefore goes with the simplest thing, and we can expand or change the interface later if it becomes necessary. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.h')
-rw-r--r--http.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/http.h b/http.h
index e64084f..473179b 100644
--- a/http.h
+++ b/http.h
@@ -144,6 +144,13 @@ struct http_get_options {
struct strbuf *content_type;
/*
+ * If non-NULL, and content_type above is non-NULL, returns
+ * the charset parameter from the content-type. If none is
+ * present, returns an empty string.
+ */
+ struct strbuf *charset;
+
+ /*
* If non-NULL, returns the URL we ended up at, including any
* redirects we followed.
*/