]> granicus.if.org Git - curl/commitdiff
examples/crawler: Fix the Accept-Encoding setting
authorJay Satiro <raysatiro@yahoo.com>
Tue, 12 Feb 2019 23:07:29 +0000 (18:07 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 12 Feb 2019 23:07:29 +0000 (18:07 -0500)
- Pass an empty string to CURLOPT_ACCEPT_ENCODING to use the default
  supported encodings.

Prior to this change the specific encodings of gzip and deflate were set
but there's no guarantee they'd be supported by the user's libcurl.

docs/examples/crawler.c

index d8fa5a459be2539aea036d489e1ea56b5846a84e..496d88c949454d108bcc390791721039de9b5c2d 100644 (file)
@@ -81,7 +81,7 @@ CURL *make_handle(char *url)
   curl_easy_setopt(handle, CURLOPT_PRIVATE, mem);
 
   /* For completeness */
-  curl_easy_setopt(handle, CURLOPT_ENCODING, "gzip, deflate");
+  curl_easy_setopt(handle, CURLOPT_ACCEPT_ENCODING, "");
   curl_easy_setopt(handle, CURLOPT_TIMEOUT, 5L);
   curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1L);
   curl_easy_setopt(handle, CURLOPT_MAXREDIRS, 10L);