Skip to content

Commit

Permalink
GMap.NET.Core: UserAgent fix
Browse files Browse the repository at this point in the history
  • Loading branch information
radioman committed Aug 30, 2016
1 parent 96bcb11 commit d4d284b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions GMap.NET.Core/GMap.NET.MapProviders/GMapProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,11 @@ public virtual void OnInitialized()
/// <summary>
/// Gets or sets the value of the User-agent HTTP header.
/// It's pseudo-randomized to avoid blockages...
/// </summary>
public static string UserAgent = string.Format("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:{0}.0) Gecko/{2}{3:00}{4:00} Firefox/{0}.0.{1}", Stuff.random.Next(3, 14), Stuff.random.Next(1, 10), Stuff.random.Next(DateTime.Today.Year - 4, DateTime.Today.Year), Stuff.random.Next(12), Stuff.random.Next(30));
/// </summary>
public static string UserAgent = string.Format("Mozilla/5.0 (Windows NT {1}.0; {2}rv:{0}.0) Gecko/20100101 Firefox/{0}.0",
Stuff.random.Next(DateTime.Today.Year - 1969 - 5, DateTime.Today.Year - 1969),
Stuff.random.Next(0, 10) % 2 == 0 ? 10 : 6,
Stuff.random.Next(0, 10) % 2 == 1 ? string.Empty : "WOW64; ");

/// <summary>
/// timeout for provider connections
Expand Down

0 comments on commit d4d284b

Please sign in to comment.