Skip to content

Commit 2ab39b8

Browse files
committed
make leading slash optional on index.html GET
1 parent e78b0a1 commit 2ab39b8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public async Task Invoke(HttpContext httpContext)
5555
return;
5656
}
5757

58-
var match = Regex.Match(path, $"^/{Regex.Escape(_options.RoutePrefix)}/?(index.(html|js))$", RegexOptions.IgnoreCase);
58+
var match = Regex.Match(path, $"^/?{Regex.Escape(_options.RoutePrefix)}/?(index.(html|js))$", RegexOptions.IgnoreCase);
5959

6060
if (match.Success)
6161
{

0 commit comments

Comments
 (0)