struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paolo Perliti (JIRA)" <>
Subject [jira] [Created] (WW-4862) Default Multipart validation regex is invalid due to charset encoding
Date Wed, 27 Sep 2017 12:40:00 GMT
Paolo Perliti created WW-4862:

             Summary: Default Multipart validation regex is invalid due to charset encoding
                 Key: WW-4862
             Project: Struts 2
          Issue Type: Bug
          Components: Dispatch Filter
    Affects Versions: 2.5.13
         Environment: JDK8
Tomcat 8.0
Struts 2.5.13
            Reporter: Paolo Perliti

Struts 2.5.12 introduced a regex matches for multipart requests. 
Struts 2.5.13 fixed [WW-4818|] issue, still it
does fails due to charset encoding being appended after the boundary marker (the regex does
not match).

Here's the header sent in browser's request:
Content-Type: multipart/form-data; boundary=---------------------------207103069210263

And this is the header handled in Struts' Dispatcher wrapRequest() method:
multipart/form-data; boundary=---------------------------207103069210263;*{color:red}charset=UTF-8{color}*

The issue seems to be related to the _applyEncoding _method (called in _prepare_ method)
    private void applyEncoding(HttpServletRequest request, String encoding) {
        try {
            if (!encoding.equals(request.getCharacterEncoding())) {
                // if the encoding is already correctly set and the parameters have been already
                // do not try to set encoding because it is useless and will cause an error
        } catch (Exception e) {
            LOG.error("Error setting character encoding to '{}' - ignoring.", encoding, e);

This message was sent by Atlassian JIRA

View raw message