Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using browser user-agent that is obviously fake #950

Open
gfto opened this issue Oct 9, 2022 · 0 comments
Open

Stop using browser user-agent that is obviously fake #950

gfto opened this issue Oct 9, 2022 · 0 comments

Comments

@gfto
Copy link

gfto commented Oct 9, 2022

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,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant