* Fix checkXmlRpc to work with content-types containing a charset subheader.

Fixes bug #628 <http://helma.org/bugs/show_bug.cgi?id=628>
This commit is contained in:
hns 2008-06-13 20:48:33 +00:00
parent 449cbd815e
commit 277737f940

View file

@ -164,7 +164,18 @@ public class RequestTrans implements Serializable {
* @return true if this might be an XML-RPC request.
*/
public synchronized boolean checkXmlRpc() {
return "POST".equals(method) && "text/xml".equals(request.getContentType());
if ("POST".equalsIgnoreCase(method)) {
String contentType = request.getContentType();
if (contentType == null) {
return false;
}
int semi = contentType.indexOf(";");
if (semi > -1) {
contentType = contentType.substring(0, semi);
}
return "text/xml".equalsIgnoreCase(contentType.trim());
}
return false;
}
/**