OpenLiveWriter
OpenLiveWriter copied to clipboard
Stop using browser user-agent that is obviously fake
Currently the following user-agent is being used "Mozilla/4.0 (compatible; MSIE 9.11; Windows NT 10.0; Open Live Writer 1.0)" (with MSIE and Windows version adjusted).
However, MSIE 9 never introduced itself as Mozilla/4 and this is triggering anti-bot warnings on some sites.
Please stop using fake user-agent and consider the following patch:
diff --git a/src/managed/OpenLiveWriter.CoreServices/ApplicationEnvironment.cs b/src/managed/OpenLiveWriter.CoreServices/ApplicationEnvironment.cs
index b4d864e..7d8505a 100644
--- a/src/managed/OpenLiveWriter.CoreServices/ApplicationEnvironment.cs
+++ b/src/managed/OpenLiveWriter.CoreServices/ApplicationEnvironment.cs
@@ -493,9 +493,9 @@ public static string FormatUserAgentString(string productName, bool browserBased
string userAgent;
if (browserBased)
{
- // e.g. "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 7.0; Open Live Writer 1.0)"
+ // e.g. "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 7.0; Open Live Writer 1.0)"
userAgent = String.Format(CultureInfo.InvariantCulture,
- "Mozilla/4.0 (compatible; MSIE {0}.{1}; Windows NT {2}.{3}; {4} 1.0)",
+ "Mozilla/5.0 (compatible; MSIE {0}.{1}; Windows NT {2}.{3}; {4} 1.0)",
majorBrowserVersion,
minorBrowserVersion,
osVersion.Major,