Skip to content

Commit

Permalink
update curl-like User-Agent headers used by some requests
Browse files Browse the repository at this point in the history
Pretend we are the current version of curl which is curl 8.10.0.
  • Loading branch information
striezel committed Sep 17, 2024
1 parent 8402016 commit 0f18540
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion updater/software/AcrobatReader2020.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public override AvailableSoftware searchForNewer()
// The request hangs and times out without an User-Agent header,
// so let's provide a simple curl User-Agent here.
var client = new HttpClient();
client.DefaultRequestHeaders.Add("User-Agent", "curl/8.9.1");
client.DefaultRequestHeaders.Add("User-Agent", "curl/8.10.0");
try
{
var task = client.GetStringAsync("https://helpx.adobe.com/acrobat/release-note/release-notes-acrobat-reader.html");
Expand Down
2 changes: 1 addition & 1 deletion updater/software/TeamSpeakClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public override AvailableSoftware searchForNewer()
{
// Looks like we have to add a user agent to get a valid response.
// Without user agent the server returns "403 Forbidden".
client.DefaultRequestHeaders.Add("User-Agent", "curl/8.9.1");
client.DefaultRequestHeaders.Add("User-Agent", "curl/8.10.0");
try
{
var task = client.GetStringAsync("https://teamspeak.com/en/downloads/");
Expand Down
2 changes: 1 addition & 1 deletion updater/software/WinMerge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public override AvailableSoftware searchForNewer()
var client = new HttpClient();
// Server returns "503 Service Unavailable" when no user agent is
// set, so we pretend to be curl.
client.DefaultRequestHeaders.Add("User-Agent", "curl/8.9.1");
client.DefaultRequestHeaders.Add("User-Agent", "curl/8.10.0");
string response;
try
{
Expand Down

0 comments on commit 0f18540

Please sign in to comment.