From 905bf5d8be98c13a24348daccf967f19f75f37f6 Mon Sep 17 00:00:00 2001 From: RakhithaRR Date: Tue, 2 Jan 2024 15:09:59 +0530 Subject: [PATCH] Add a null check for response message context to skip engaging interceptors --- .../org/apache/synapse/transport/passthru/TargetHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java b/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java index 1480e49f44..76f5694006 100644 --- a/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java +++ b/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java @@ -624,7 +624,8 @@ public void inputReady(NHttpClientConnection conn, ContentDecoder decoder) { int responseRead = -1; boolean interceptionEnabled = false; Boolean[] interceptorResults = new Boolean[noOfInterceptors]; - if (interceptStream) { + if (conn.getContext().getAttribute(PassThroughConstants.RESPONSE_MESSAGE_CONTEXT) != null + && interceptStream) { int index = 0; for (StreamInterceptor interceptor : streamInterceptors) { interceptorResults[index] = interceptor.interceptTargetResponse(