-
Notifications
You must be signed in to change notification settings - Fork 896
Open
Labels
Type: EnhancementNew feature or requestNew feature or requestsingle_exeIssues that apply when a shipping YARP as a single exeIssues that apply when a shipping YARP as a single exe
Milestone
Description
Describe the bug
Let's say I want to have an SPA served from https://example.com, and its APIs from https://example.com/api/name-of-api.
I would imagine setting up the two routes like this:
[
{
"RouteId": "app",
"Match": {
"Path": "/{**any}"
},
"ClusterId": "app"
},
{
"RouteId": "first-api",
"Match": {
"Path": "/api/first-api/{*any}"
},
"ClusterId": "first-api"
},
{
"RouteId": "second-api",
"Match": {
"Path": "/api/second-api/{*any}"
},
"ClusterId": "second-api"
}
]All three of these URLs will work as intended:
https://example.com/
https://example.com/api/first-api
https://example.com/api/second-api
But this URL will also be accepted, and quietly return the same as https://example.com
https://example.com/api/third-and-totally-invalid-api
Ideally, I would want to instruct the proxy to reject that route with a 404, perhaps with something like this:
{
"RouteId": "invalid-api",
"Match": {
"Path": "/api/{*any}"
},
StatusCode: 404
},To Reproduce
Listed in the description
Further technical details
Yarp.ReverseProxy 1.1.1
On Windows 10, .NET 6
Metadata
Metadata
Assignees
Labels
Type: EnhancementNew feature or requestNew feature or requestsingle_exeIssues that apply when a shipping YARP as a single exeIssues that apply when a shipping YARP as a single exe