From 1443a1a2bbb8e32e56788109d8285db250d55c8b Mon Sep 17 00:00:00 2001 From: Aaron Ogburn Date: Fri, 8 Apr 2022 17:18:29 -0400 Subject: [PATCH] [UNDERTOW-2060] fix double AJP response --- .../java/io/undertow/server/protocol/ajp/AjpReadListener.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/main/java/io/undertow/server/protocol/ajp/AjpReadListener.java b/core/src/main/java/io/undertow/server/protocol/ajp/AjpReadListener.java index e6012bce16..8f9c94abb0 100644 --- a/core/src/main/java/io/undertow/server/protocol/ajp/AjpReadListener.java +++ b/core/src/main/java/io/undertow/server/protocol/ajp/AjpReadListener.java @@ -58,7 +58,7 @@ final class AjpReadListener implements ChannelListener { private static final byte[] CPONG = {'A', 'B', 0, 1, 9}; private static final byte[] SEND_HEADERS_INTERNAL_SERVER_ERROR_MSG = {'A', 'B', 0, 8, 4, (byte)((500 >> 8) & 0xFF) , (byte)(500 & 0xFF), 0, 0, '\0', 0, 0}; private static final byte[] SEND_HEADERS_BAD_REQUEST_MSG = {'A', 'B', 0, 8, 4, (byte)((400 >> 8) & 0xFF) , (byte)(400 & 0xFF), 0, 0, '\0', 0, 0}; - private static final byte[] END_RESPONSE = {'A', 'B', 0, 2, 5, 1}; + private static final byte[] END_RESPONSE = {'A', 'B', 0, 2, 5, 0}; private final AjpServerConnection connection; private final String scheme; @@ -235,7 +235,6 @@ public void handleEvent(AjpServerResponseConduit channel) { if(oldState.badRequest) { httpServerExchange.setStatusCode(StatusCodes.BAD_REQUEST); httpServerExchange.endExchange(); - handleBadRequest(); safeClose(connection); } else { Connectors.executeRootHandler(connection.getRootHandler(), httpServerExchange);