-
Bug
-
Resolution: Done
-
Major
-
1.0.2.GA
Resteasy uses the request content-type information to find a suitable reader. It seems it is currently doing it in a case sensitive way. I think it should be case insensitive.
So if I have a content-type
multipart/form-data it passes
Multipart/form-data it fails
multipart/Form-data it does not fail, but I think it is because resteasy looks up wildcard matches for subtypes too.
In method o.j.resteasy.core.MediaTypeMap.getPossible(MediaType) has a part currently looking so:
SubtypeMap<T> indexed = index.get(accept.getType());
instead accept.getType() there should be accept.getType().toLowerCase().
And in o.j.resteasy.core.MediaTypeMap.SubtypeMap.getPossible(MediaType) there are several calls to accept.getSubtype() they should all be accept.getSubtype().toLowerCase().
Interesting side note: when resteasy can't find a reader it throws an exception but in the exception message the content-type information is already lowercased, because in o.j.resteasy.plugins.delegates.MediaTypeHeaderDelegate.toString() has this:
String rtn = type.getType().toLowerCase() + "/" + type.getSubtype().toLowerCase();