diff options
author | crupest <crupest@outlook.com> | 2021-04-30 17:53:40 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-04-30 17:53:40 +0800 |
commit | e536121d97610af09d6bf4a51a875b0f7d50f702 (patch) | |
tree | 4f6e2f0ddae0920cc1ef3213dc36953a95bb2fc8 /BackEnd/Timeline/Routes/UnknownEndpointMiddleware.cs | |
parent | 9f81ec1d4a54239ae9456923115f4a1e379d9e71 (diff) | |
download | timeline-e536121d97610af09d6bf4a51a875b0f7d50f702.tar.gz timeline-e536121d97610af09d6bf4a51a875b0f7d50f702.tar.bz2 timeline-e536121d97610af09d6bf4a51a875b0f7d50f702.zip |
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Routes/UnknownEndpointMiddleware.cs')
-rw-r--r-- | BackEnd/Timeline/Routes/UnknownEndpointMiddleware.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/BackEnd/Timeline/Routes/UnknownEndpointMiddleware.cs b/BackEnd/Timeline/Routes/UnknownEndpointMiddleware.cs index 25ec563c..d3f78fd9 100644 --- a/BackEnd/Timeline/Routes/UnknownEndpointMiddleware.cs +++ b/BackEnd/Timeline/Routes/UnknownEndpointMiddleware.cs @@ -24,7 +24,9 @@ namespace Timeline.Routes context.Response.StatusCode = StatusCodes.Status400BadRequest;
context.Response.ContentType = MediaTypeNames.Application.Json;
- var body = JsonSerializer.SerializeToUtf8Bytes(ErrorResponse.Common.UnknownEndpoint(), new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
+ var body = JsonSerializer.SerializeToUtf8Bytes(
+ new CommonResponse(ErrorCodes.Common.UnknownEndpoint, Resource.MessageUnknownEndpoint),
+ new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
context.Response.ContentLength = body.Length;
await context.Response.Body.WriteAsync(body);
|