From 131224a70d334f91b22bfcb71c1873ff25cc2a55 Mon Sep 17 00:00:00 2001 From: "martin.cong" Date: Tue, 10 Oct 2023 15:26:32 +0800 Subject: [PATCH] uri --- .../main/java/com/bt/http/server/AbstractHttpHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/http-server/src/main/java/com/bt/http/server/AbstractHttpHandler.java b/http-server/src/main/java/com/bt/http/server/AbstractHttpHandler.java index e8d2b88..e7ca7e6 100644 --- a/http-server/src/main/java/com/bt/http/server/AbstractHttpHandler.java +++ b/http-server/src/main/java/com/bt/http/server/AbstractHttpHandler.java @@ -86,7 +86,7 @@ protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) } } - writeNotFound(ctx); + writeNotFound(ctx,uri); } void writeHandler(ChannelHandlerContext ctx, Handler handler, ParamDTO dto, HttpHeaders requestHeaders){ @@ -155,11 +155,11 @@ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cau ctx.close(); } - private static void writeNotFound( ChannelHandlerContext ctx) { + private static void writeNotFound( ChannelHandlerContext ctx,String uri) { var status = HttpResponseStatus.NOT_FOUND; writeResponse(ctx, status, TYPE_PLAIN, - ("{\"code\":404,\"message\":\""+status.reasonPhrase()+"\"}").getBytes(StandardCharsets.UTF_8) + ("{\"code\":404,\"message\":\""+uri+" , "+ status.reasonPhrase()+"\"}").getBytes(StandardCharsets.UTF_8) ,null); }