Move `User-Agent` value to `VersionInfo` and ensure it's valid
fixes e22082c6b
This commit is contained in:
parent
133ff5a77e
commit
cda23dd38e
|
@ -25,7 +25,7 @@ namespace BizHawk.Client.Common
|
||||||
_takeScreenshotCallback = takeScreenshotCallback;
|
_takeScreenshotCallback = takeScreenshotCallback;
|
||||||
GetUrl = getURL;
|
GetUrl = getURL;
|
||||||
PostUrl = postURL;
|
PostUrl = postURL;
|
||||||
_client.DefaultRequestHeaders.UserAgent.ParseAdd($"BizHawk/{VersionInfo.GetEmuVersion()}");
|
_client.DefaultRequestHeaders.UserAgent.ParseAdd(VersionInfo.UserAgentEscaped);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ExecGet(string url = null) => Get(url ?? GetUrl).Result;
|
public string ExecGet(string url = null) => Get(url ?? GetUrl).Result;
|
||||||
|
|
|
@ -22,6 +22,8 @@ namespace BizHawk.Common
|
||||||
|
|
||||||
public static readonly string BizHawkContributorsListURI = "https://github.com/TASEmulators/BizHawk/graphs/contributors";
|
public static readonly string BizHawkContributorsListURI = "https://github.com/TASEmulators/BizHawk/graphs/contributors";
|
||||||
|
|
||||||
|
public static readonly string UserAgentEscaped;
|
||||||
|
|
||||||
static VersionInfo()
|
static VersionInfo()
|
||||||
{
|
{
|
||||||
var path = Path.Combine(
|
var path = Path.Combine(
|
||||||
|
@ -37,6 +39,7 @@ namespace BizHawk.Common
|
||||||
CustomBuildString = lines[0];
|
CustomBuildString = lines[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
UserAgentEscaped = $"BizHawk/{MainVersion}{(DeveloperBuild ? "-dev" : string.Empty)}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static (string Label, string TargetURI) GetGitCommitLink()
|
public static (string Label, string TargetURI) GetGitCommitLink()
|
||||||
|
|
Loading…
Reference in New Issue