-
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.area-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
When making a call to a non-existent url, the getasync should return 404 not found error, however it is always returning response status as ok, even though there is no catch all situation I have implemented.
Further, when enabled verbose logging (screenshot below), I get the following information but the response status was sent as 200.
public async Task Get_Should_ThrowError_When_ARoute_Is_Invalid()
{
var hostBuilder =
new HostBuilder().ConfigureWebHost(webHost =>
{
webHost.UseTestServer();
webHost.UseStartup<Startup>();
});
var host = hostBuilder.StartAsync().Result;
await Assert.ThrowsAsync<Exception>(async () =>
{
var client = host.GetTestClient();
var response = await client.GetAsync($"RequestUri");
var result = await response.Content.ReadAsStringAsync();
});
}
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.area-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