Set a user agent for HttpCommunication
This commit is contained in:
parent
5b5652d01e
commit
e22082c6b4
|
@ -2,6 +2,8 @@ using System.Collections.Generic;
|
|||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using BizHawk.Common;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public sealed class HttpCommunication
|
||||
|
@ -23,6 +25,7 @@ namespace BizHawk.Client.Common
|
|||
_takeScreenshotCallback = takeScreenshotCallback;
|
||||
GetUrl = getURL;
|
||||
PostUrl = postURL;
|
||||
_client.DefaultRequestHeaders.UserAgent.ParseAdd($"BizHawk/{VersionInfo.GetEmuVersion()}");
|
||||
}
|
||||
|
||||
public string ExecGet(string url = null) => Get(url ?? GetUrl).Result;
|
||||
|
|
Loading…
Reference in New Issue