From 5cebe1ce89e218a56aa4ff2be4e2cdb32ba7bc82 Mon Sep 17 00:00:00 2001 From: Igor Dmitriev Date: Wed, 31 May 2017 20:41:36 +0300 Subject: [PATCH] Fix - NPE in ClientToProxyConnection while closing the client connection --- .../org/littleshoot/proxy/impl/ClientToProxyConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/littleshoot/proxy/impl/ClientToProxyConnection.java b/src/main/java/org/littleshoot/proxy/impl/ClientToProxyConnection.java index 32d8d01ec..13aae92db 100644 --- a/src/main/java/org/littleshoot/proxy/impl/ClientToProxyConnection.java +++ b/src/main/java/org/littleshoot/proxy/impl/ClientToProxyConnection.java @@ -866,7 +866,7 @@ private boolean shouldCloseClientConnection(HttpRequest req, } } - if (!HttpHeaders.isKeepAlive(req)) { + if (req != null && !HttpHeaders.isKeepAlive(req)) { LOG.debug("Closing client connection since request is not keep alive: {}", req); // Here we simply want to close the connection because the // client itself has requested it be closed in the request.