Skip to content

Commit e332b57

Browse files
Mahdiglnbaywet
andauthored
Update src/Microsoft.OpenApi.Readers/V2/OpenApiDocumentDeserializer.cs
Co-authored-by: Vincent Biret <vincentbiret@hotmail.com>
1 parent 664a2f4 commit e332b57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.OpenApi.Readers/V2/OpenApiDocumentDeserializer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ private static string BuildUrl(string scheme, string host, string basePath)
237237
}
238238

239239
// Remove default ports to clean up the URL
240-
if ((uriBuilder.Scheme == "https" && uriBuilder.Port == 443) ||
241-
(uriBuilder.Scheme == "http" && uriBuilder.Port == 80))
240+
if (("https".Equals(uriBuilder.Scheme, StringComparison.OrdinalIgnoreCase) && uriBuilder.Port == 443) ||
241+
("http".Equals(uriBuilder.Scheme, StringComparison.OrdinalIgnoreCase) && uriBuilder.Port == 80))
242242
{
243243
uriBuilder.Port = -1; // Setting to -1 removes the port from the URL
244244
}

0 commit comments

Comments
 (0)