Skip to content

Commit

Permalink
set a custom user-agent to use with libcurl
Browse files Browse the repository at this point in the history
  • Loading branch information
p2r3 committed Dec 4, 2024
1 parent 2614d96 commit df4e5ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ bool ToolsCURL::downloadFile (const std::string &url, const std::filesystem::pat
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlFileWriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ofs);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "spplice/3.0");

CURLcode response = curl_easy_perform(curl);

Expand Down Expand Up @@ -93,6 +94,7 @@ std::string ToolsCURL::downloadString (const std::string &url) {
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlStringWriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "spplice/3.0");

// Perform the request
CURLcode response = curl_easy_perform(curl);
Expand Down

0 comments on commit df4e5ec

Please sign in to comment.