Use StatusCodes.Status404NotFound instead of 404 (#18453)
This is a minor change to improve consistency and use `StatusCodes` members instead of raw harcoded status code numbers. It may help beginners browsing through the code-base to find where the default 404 response comes from for unmatched requests.
This commit is contained in:
parent
c848c33cfa
commit
237b697320
|
|
@ -96,7 +96,7 @@ namespace Microsoft.AspNetCore.Builder
|
|||
throw new InvalidOperationException(message);
|
||||
}
|
||||
|
||||
context.Response.StatusCode = 404;
|
||||
context.Response.StatusCode = StatusCodes.Status404NotFound;
|
||||
return Task.CompletedTask;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue