Changeset 9118

Show
Ignore:
Timestamp:
06/13/08 22:48:33 (4 months ago)
Author:
hannes
Message:

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

Fixes bug #628 <http://helma.org/bugs/show_bug.cgi?id=628>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • helma/helma/trunk/src/helma/framework/RequestTrans.java

    r8792 r9118  
    165165     */ 
    166166    public synchronized boolean checkXmlRpc() { 
    167         return "POST".equals(method) && "text/xml".equals(request.getContentType()); 
     167        if ("POST".equalsIgnoreCase(method)) { 
     168            String contentType = request.getContentType(); 
     169            if (contentType == null) { 
     170                return false; 
     171            } 
     172            int semi = contentType.indexOf(";"); 
     173            if (semi > -1) { 
     174                contentType = contentType.substring(0, semi); 
     175            } 
     176            return "text/xml".equalsIgnoreCase(contentType.trim()); 
     177        } 
     178        return false; 
    168179    } 
    169180