Skip to content

Commit 1d35f0b

Browse files
committed
Add OrdinalIgnoreCase for string comparison
1 parent 2595c94 commit 1d35f0b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Microsoft.OpenApi.Readers/OpenApiVersionExtensionMethods.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4+
using System;
5+
46
namespace Microsoft.OpenApi.Readers
57
{
68
/// <summary>
@@ -16,7 +18,7 @@ public static class OpenApiVersionExtensionMethods
1618
public static bool is2_0(this string version)
1719
{
1820
bool result = false;
19-
if (version.Equals("2.0"))
21+
if (version.Equals("2.0", StringComparison.OrdinalIgnoreCase))
2022
{
2123
result = true;
2224
}
@@ -32,7 +34,7 @@ public static bool is2_0(this string version)
3234
public static bool is3_0(this string version)
3335
{
3436
bool result = false;
35-
if (version.StartsWith("3.0"))
37+
if (version.StartsWith("3.0", StringComparison.OrdinalIgnoreCase))
3638
{
3739
result = true;
3840
}
@@ -48,7 +50,7 @@ public static bool is3_0(this string version)
4850
public static bool is3_1(this string version)
4951
{
5052
bool result = false;
51-
if (version.StartsWith("3.1"))
53+
if (version.StartsWith("3.1", StringComparison.OrdinalIgnoreCase))
5254
{
5355
result = true;
5456
}

0 commit comments

Comments
 (0)