Issue #1676 remove deprecated methods on HttpFields

This commit is contained in:
Greg Wilkins 2017-07-19 10:45:21 +02:00
parent 5a05e953b9
commit f1146856ac
1 changed files with 4 additions and 4 deletions

View File

@ -259,14 +259,14 @@ public abstract class HttpReceiver
ResponseNotifier notifier = getHttpDestination().getResponseNotifier(); ResponseNotifier notifier = getHttpDestination().getResponseNotifier();
notifier.notifyHeaders(exchange.getConversation().getResponseListeners(), response); notifier.notifyHeaders(exchange.getConversation().getResponseListeners(), response);
Enumeration<String> contentEncodings = response.getHeaders().getValues(HttpHeader.CONTENT_ENCODING.asString(), ","); List<String> contentEncodings = response.getHeaders().getCSV(HttpHeader.CONTENT_ENCODING.asString(), false);
if (contentEncodings != null) if (contentEncodings != null && !contentEncodings.isEmpty())
{ {
for (ContentDecoder.Factory factory : getHttpDestination().getHttpClient().getContentDecoderFactories()) 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(); this.decoder = factory.newContentDecoder();
break; break;