diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java index a2d978ef0d7..dd6a2bc131b 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java @@ -259,14 +259,14 @@ public abstract class HttpReceiver ResponseNotifier notifier = getHttpDestination().getResponseNotifier(); notifier.notifyHeaders(exchange.getConversation().getResponseListeners(), response); - Enumeration contentEncodings = response.getHeaders().getValues(HttpHeader.CONTENT_ENCODING.asString(), ","); - if (contentEncodings != null) + List contentEncodings = response.getHeaders().getCSV(HttpHeader.CONTENT_ENCODING.asString(), false); + if (contentEncodings != null && !contentEncodings.isEmpty()) { for (ContentDecoder.Factory factory : getHttpDestination().getHttpClient().getContentDecoderFactories()) { - while (contentEncodings.hasMoreElements()) + for (String encoding: contentEncodings) { - if (factory.getEncoding().equalsIgnoreCase(contentEncodings.nextElement())) + if (factory.getEncoding().equalsIgnoreCase(encoding)) { this.decoder = factory.newContentDecoder(); break;