Description
Here is source code from cxf-2.1.x-fixes branch for org.apache.cxf.attachment.AttachmentUtil.java
public static boolean isTypeSupported(String contentType, List<String> types) { if (contentType == null) { return false; } for (String s : types) { if (contentType.indexOf(s) != -1) { return true; } } return false; }
So if a client sends in a SOAP request with attachment with Content-Type as "Multipart/Related" instead of "multipart/related", then this method will always return false as result. The spec says that the Content-Type should be case-insensitive. It should not matter whether the client sends in "Multipart/Related" or "multipart/related".
I have attached a patch to fix this. Basically, I just simply modified this method to:
public static boolean isTypeSupported(String contentType, List<String> types) { if (contentType == null) { return false; } for (String s : types) { if (contentType.toLowerCase().indexOf(s) != -1) { return true; } } return false; }