playframework/Play20 — pull request #625 by jroper (2012-12-20 15:25:40+00:00)
Title: Support application/xml, and prefer it over text/xml

Currently Play uses text/xml as the default mime type for XML, and only parses XML if it is text/xml.

text/xml however is frowned upon as the mime type for XML, it's recommended that application/xml should be used instead, because text/xml introduces ambiguities in the way encoding should be handled, though it turns out no browsers actually implement text/xml handling correctly according to the RFC. Needless to say, application/xml should be preferred.

Furthermore, many XML formats use mime types in the format application/XXX+xml, eg, application/atom+xml, application/rdf+xml, application/xhtml+xml. Play should parse these as XML too, without having to resort to using tolerantXml.

So this makes Play consider text/xml, application/xml and application/XXX+xml all as XML, and also makes Play, by default, send XML as application/xml, when it returns XML from a request or submits it in the WS API.