Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set CURLOPT_FOLLOWLOCATION before grabbing the HTTP header, not after.

  • Loading branch information...
commit bc267cb5ed27036edae3c66eb1270125f296eba0 1 parent 8d1b0b5
@tm512 authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/modules/linktitle/main.c
View
2  src/modules/linktitle/main.c
@@ -149,6 +149,7 @@ void linktitle (ircclient_t *cl, char *nick, char *host, char *source, char *mes
curl_easy_setopt (c, CURLOPT_WRITEHEADER, (void*) &head);
curl_easy_setopt (c, CURLOPT_WRITEDATA, (void*) &body);
curl_easy_setopt (c, CURLOPT_NOBODY, 1);
+ curl_easy_setopt (c, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_perform (c);
if (!strstr (head.data, "Content-Type: text/html"))
@@ -156,7 +157,6 @@ void linktitle (ircclient_t *cl, char *nick, char *host, char *source, char *mes
// Get the body of the http request
curl_easy_setopt (c, CURLOPT_HTTPGET, 1);
- curl_easy_setopt (c, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt (c, CURLOPT_WRITEHEADER, NULL);
curl_easy_perform (c);
curl_easy_cleanup (c);
Please sign in to comment.
Something went wrong with that request. Please try again.