Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.jboss.resteasy.plugins.interceptors;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;

import javax.annotation.Priority;
Expand Down Expand Up @@ -43,7 +43,7 @@ public void filter(ContainerRequestContext requestContext,
if (HttpResponseCodes.SC_BAD_REQUEST == responseContext.getStatus()) {
Object entity = responseContext.getEntity();
if (entity != null && entity instanceof String) {
ArrayList<Object> contentTypes = (ArrayList<Object>)responseContext.getHeaders().get("Content-Type");
List<Object> contentTypes = responseContext.getHeaders().get("Content-Type");
if (contentTypes != null && containsHtmlText(contentTypes)) {
String escapedMsg = escapeXml((String) entity);
responseContext.setEntity(escapedMsg);
Expand Down Expand Up @@ -88,7 +88,7 @@ private String escapeXml(String str) {
return sb.toString();
}

private boolean containsHtmlText(ArrayList<Object> list) {
private boolean containsHtmlText(List<Object> list) {
for (Object o :list) {
if (o instanceof MediaType && MediaType.TEXT_HTML_TYPE.isCompatible((MediaType) o)) {
return true;
Expand Down