diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java index 54ace6faf68..e859d72eed8 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java @@ -135,13 +135,12 @@ public abstract class HttpConnection implements Connection if (cookieStore != null) { URI uri = request.getURI(); + StringBuilder cookies = null; if (uri != null) - { - StringBuilder cookies = convertCookies(cookieStore.get(uri), null); - cookies = convertCookies(request.getCookies(), cookies); - if (cookies != null) - request.header(HttpHeader.COOKIE.asString(), cookies.toString()); - } + cookies = convertCookies(cookieStore.get(uri), null); + cookies = convertCookies(request.getCookies(), cookies); + if (cookies != null) + request.header(HttpHeader.COOKIE.asString(), cookies.toString()); } // Authorization