From 30b7f5480913ac5d051889eb878148bb1807941d Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Thu, 12 Sep 2019 14:58:34 -0400 Subject: Only GET the final redirect location --- bin/title.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bin/title.c') diff --git a/bin/title.c b/bin/title.c index 3ea54e4e..199c18d8 100644 --- a/bin/title.c +++ b/bin/title.c @@ -125,6 +125,11 @@ static CURLcode fetchTitle(const char *url) { if (code) return code; if (!type || strncmp(type, "text/html", 9)) return CURLE_OK; + char *dest; + curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &dest); + code = curl_easy_setopt(curl, CURLOPT_URL, dest); + if (code) return code; + body.len = 0; title = false; curl_easy_setopt(curl, CURLOPT_NOBODY, 0L); -- cgit 1.4.1