mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 06:55:04 +00:00
Set User-Agent header in ImageLoader
This commit is contained in:
parent
3b9db5b149
commit
b5c177b563
4 changed files with 6 additions and 7 deletions
|
|
@ -27,8 +27,13 @@ namespace MapControl
|
|||
/// <summary>
|
||||
/// The System.Net.Http.HttpClient instance used to download images via a http or https Uri.
|
||||
/// </summary>
|
||||
public static HttpClient HttpClient { get; set; } = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };
|
||||
public static HttpClient HttpClient { get; set; } = new HttpClient();
|
||||
|
||||
static ImageLoader()
|
||||
{
|
||||
HttpClient.Timeout = TimeSpan.FromSeconds(30);
|
||||
HttpClient.DefaultRequestHeaders.Add("User-Agent", $"XAML-Map-Control/{typeof(ImageLoader).Assembly.GetName().Version}");
|
||||
}
|
||||
|
||||
public static async Task<ImageSource> LoadImageAsync(Uri uri, IProgress<double> progress = null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue