dotnet / dotnet/aspnetcore

TemplateBinder strip trailing slash

Open
#57,988 3 comments 5 reactions 0 assignees View on GitHub
area-mvc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

When the route is defined as `Test/{val1}` and `val1` is empty, the result is `Test` (without trailing slash).

Trailing slash do matter in some cases.

### Expected Behavior

When the route is defined as `Test/{val1}` and `val1` is empty, the result is `Test/` (**with** trailing slash).

### Steps To Reproduce

https://github.com/dotnet/aspnetcore/blob/73c82c6a41b08b65753461c3273d4990cd5c747e/src/Http/Routing/test/UnitTests/Template/TemplateBinderTests.cs#L60

### Exceptions (if any)

_No response_

### .NET Version

8

### Anything else?

Related issue: https://github.com/microsoft/reverse-proxy/issues/2531

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.