Skip to content

Commit 519ca9d

Browse files
committed
fix #79
1 parent 521bd5b commit 519ca9d

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

DeviceDetector.NET.Tests/DeviceDetectorTest.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,24 @@ public void TestIssue79()
624624
});
625625

626626
var dd = DeviceDetector.GetInfoFromUserAgent(userAgent, clientHints);
627+
dd.Match.Client.Name.Should().NotBe("Iridium");
628+
dd.Success.Should().BeTrue();
629+
}
630+
631+
/// <summary>
632+
/// Issue #79 part 2
633+
/// </summary>
634+
[Fact]
635+
public void TestIssue79_Test2()
636+
{
637+
var userAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36";
638+
var clientHints = ClientHints.Factory(new Dictionary<string, string>
639+
{
640+
["Sec-Ch-Ua-Full-Version-List"] = "\"Chromium\";v=\"122.0.6261.69\", \"Not(A:Brand\";v=\"24.0.0.0\", \"Google Chrome\";v=\"122.0.6261.69\"",
641+
});
642+
643+
var dd = DeviceDetector.GetInfoFromUserAgent(userAgent, clientHints);
644+
dd.Match.Client.Name.Should().NotBe("Iridium");
627645
dd.Success.Should().BeTrue();
628646
}
629647
}

DeviceDetector.NET/DeviceDetector.NET.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
3636
<PackageReference Include="YamlDotNet" Version="15.1.2" />
3737

38-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" Condition="'$(TargetFramework)' == 'net8.0'" />
38+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" Condition="'$(TargetFramework)' == 'net8.0'" />
3939
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" Condition="'$(TargetFramework)' == 'net7.0'" />
4040

4141
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" Condition="'$(TargetFramework)' == 'net6.0'" />
4242
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" Condition="'$(TargetFramework)' == 'net5.0'" />
4343

4444
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" Condition="'$(TargetFramework)' == 'net462'" />
45-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
45+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
4646
</ItemGroup>
4747

4848
<ItemGroup>

DeviceDetector.NET/Parser/Client/BrowserParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ public override ParseResult<ClientMatchResult> Parse()
792792
// If the version reported from the client hints is YYYY or YYYY.MM (e.g., 2022 or 2022.04),
793793
// then it is the Iridium browser
794794
// https://iridiumbrowser.de/news/
795-
if (!GetRegexEngine().Match(client.Version, "/^202[0-4]/")){
795+
if (GetRegexEngine().Match(client.Version, "/^202[0-4]/")){
796796
client.Name = "Iridium";
797797
client.ShortName = "I1";
798798
}

0 commit comments

Comments
 (0)