-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
The application calls app.UsePathBase() before app.UseRouting(), as recommended workaround described here . The controller method is reachable over both /xxx and /MyBasePath/xxx URLs. Swagger displays /xxx as method url.
...
app.UsePathBase("/MyBasePath");
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseRouting();
...
Expected Behavior
The controller method should be reachable only over /MyBasePath/xxx URL.
Swagger should display /MyBasePath/xxx
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
7.0.100
Anything else?
The ASP.NET Core application targets NET 6,.
VS 2022 is used as IDE
Metadata
Metadata
Assignees
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions