diff options
-rw-r--r-- | http.c | 4 | ||||
-rw-r--r-- | http.h | 6 |
2 files changed, 10 insertions, 0 deletions
@@ -894,6 +894,10 @@ static int http_request(const char *url, curlinfo_strbuf(slot->curl, CURLINFO_CONTENT_TYPE, options->content_type); + if (options && options->effective_url) + curlinfo_strbuf(slot->curl, CURLINFO_EFFECTIVE_URL, + options->effective_url); + curl_slist_free_all(headers); strbuf_release(&buf); @@ -133,6 +133,12 @@ struct http_get_options { /* If non-NULL, returns the content-type of the response. */ struct strbuf *content_type; + + /* + * If non-NULL, returns the URL we ended up at, including any + * redirects we followed. + */ + struct strbuf *effective_url; }; /* Return values for http_get_*() */ |