From 8601f65f1711ab9e4ac7dcc71699b9172bd472b1 Mon Sep 17 00:00:00 2001 From: BEN ABT Date: Wed, 14 Jun 2023 12:40:55 +0200 Subject: [PATCH] change to ua version value for safari (#37) --- src/MyCSharp.HttpUserAgentParser/HttpUserAgentStatics.cs | 2 +- .../HttpUserAgentParserTests.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/MyCSharp.HttpUserAgentParser/HttpUserAgentStatics.cs b/src/MyCSharp.HttpUserAgentParser/HttpUserAgentStatics.cs index ee2544f..1fd6eb5 100644 --- a/src/MyCSharp.HttpUserAgentParser/HttpUserAgentStatics.cs +++ b/src/MyCSharp.HttpUserAgentParser/HttpUserAgentStatics.cs @@ -106,7 +106,7 @@ public static class HttpUserAgentStatics { CreateDefaultBrowserRegex("Camino"), "Camino" }, { CreateDefaultBrowserRegex("Netscape"), "Netscape" }, { CreateDefaultBrowserRegex("OmniWeb"), "OmniWeb" }, - { CreateDefaultBrowserRegex("Safari"), "Safari" }, + { CreateDefaultBrowserRegex("Version"), "Safari" }, // https://github.com/mycsharp/HttpUserAgentParser/issues/34 { CreateDefaultBrowserRegex("Mozilla"), "Mozilla" }, { CreateDefaultBrowserRegex("Konqueror"), "Konqueror" }, { CreateDefaultBrowserRegex("icab"), "iCab" }, diff --git a/tests/MyCSharp.HttpUserAgentParser.UnitTests/HttpUserAgentParserTests.cs b/tests/MyCSharp.HttpUserAgentParser.UnitTests/HttpUserAgentParserTests.cs index 2e42407..e97775a 100644 --- a/tests/MyCSharp.HttpUserAgentParser.UnitTests/HttpUserAgentParserTests.cs +++ b/tests/MyCSharp.HttpUserAgentParser.UnitTests/HttpUserAgentParserTests.cs @@ -33,10 +33,10 @@ public class HttpUserAgentParserTests [InlineData("Mozilla/5.0 (Linux; Android 10; SM-A205U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Mobile Safari/537.36", "Chrome", "90.0.4430.210", "Android", HttpUserAgentPlatformType.Android, "Android")] [InlineData("Mozilla/5.0 (Linux; Android 10; LM-Q720) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Mobile Safari/537.36", "Chrome", "90.0.4430.210", "Android", HttpUserAgentPlatformType.Android, "Android")] // Safari - [InlineData("Mozilla/5.0 (Windows; U; Windows NT 10.0; en-US) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/11.0 Safari/605.1.15", "Safari", "605.1.15", "Windows 10", HttpUserAgentPlatformType.Windows, null)] - [InlineData("Mozilla/5.0 (Macintosh; Intel Mac OS X 11_3_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15", "Safari", "605.1.15", "Mac OS X", HttpUserAgentPlatformType.MacOS, null)] - [InlineData("Mozilla/5.0 (iPhone; CPU iPhone OS 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1", "Safari", "604.1", "iOS", HttpUserAgentPlatformType.IOS, "Apple iPhone")] - [InlineData("Mozilla/5.0 (iPod touch; CPU iPhone 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1", "Safari", "604.1", "iOS", HttpUserAgentPlatformType.IOS, "Apple iPod")] + [InlineData("Mozilla/5.0 (Windows; U; Windows NT 10.0; en-US) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/11.0 Safari/605.1.15", "Safari", "11.0", "Windows 10", HttpUserAgentPlatformType.Windows, null)] + [InlineData("Mozilla/5.0 (Macintosh; Intel Mac OS X 11_3_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15", "Safari", "14.1", "Mac OS X", HttpUserAgentPlatformType.MacOS, null)] + [InlineData("Mozilla/5.0 (iPhone; CPU iPhone OS 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1", "Safari", "14.0", "iOS", HttpUserAgentPlatformType.IOS, "Apple iPhone")] + [InlineData("Mozilla/5.0 (iPod touch; CPU iPhone 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1", "Safari", "14.0", "iOS", HttpUserAgentPlatformType.IOS, "Apple iPod")] // Edge [InlineData("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 Edg/90.0.818.51", "Edge", "90.0.818.51", "Windows 10", HttpUserAgentPlatformType.Windows, null)] [InlineData("Mozilla/5.0 (Macintosh; Intel Mac OS X 11_3_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 Edg/90.0.818.51", "Edge", "90.0.818.51", "Mac OS X", HttpUserAgentPlatformType.MacOS, null)]