diff --git a/src/Microsoft.OpenApi/Services/OpenApiUrlTreeNode.cs b/src/Microsoft.OpenApi/Services/OpenApiUrlTreeNode.cs index 38b571112..425250fc9 100644 --- a/src/Microsoft.OpenApi/Services/OpenApiUrlTreeNode.cs +++ b/src/Microsoft.OpenApi/Services/OpenApiUrlTreeNode.cs @@ -150,7 +150,7 @@ public OpenApiUrlTreeNode Attach(string path, } var segments = path.Split('/'); - if (path.EndsWith("/")) + if (path.EndsWith("/", StringComparison.OrdinalIgnoreCase)) { // Remove the last element, which is empty, and append the trailing slash to the new last element // This is to support URLs with trailing slashes