From f1146856ac702547f6ea5ee039f90447e1170701 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 19 Jul 2017 10:45:21 +0200 Subject: [PATCH] Issue #1676 remove deprecated methods on HttpFields --- .../main/java/org/eclipse/jetty/client/HttpReceiver.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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;