* 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:
parent
449cbd815e
commit
277737f940
1 changed files with 12 additions and 1 deletions
|
@ -164,7 +164,18 @@ public class RequestTrans implements Serializable {
|
||||||
* @return true if this might be an XML-RPC request.
|
* @return true if this might be an XML-RPC request.
|
||||||
*/
|
*/
|
||||||
public synchronized boolean checkXmlRpc() {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue