[ 
https://issues.apache.org/jira/browse/WW-5401?focusedWorklogId=908554&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-908554
 ]

ASF GitHub Bot logged work on WW-5401:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Mar/24 13:22
            Start Date: 06/Mar/24 13:22
    Worklog Time Spent: 10m 
      Work Description: sepe81 commented on code in PR #892:
URL: https://github.com/apache/struts/pull/892#discussion_r1514476089


##########
core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java:
##########
@@ -1026,9 +1030,12 @@ protected boolean isMultipartRequest(HttpServletRequest 
request) {
         String httpMethod = request.getMethod();
         String contentType = request.getContentType();
 
-        return REQUEST_POST_METHOD.equalsIgnoreCase(httpMethod) &&
-            contentType != null &&
-            
multipartValidationPattern.matcher(contentType.toLowerCase(Locale.ENGLISH)).matches();
+        boolean isPostRequest = 
REQUEST_POST_METHOD.equalsIgnoreCase(httpMethod);
+        boolean isProperContentType = contentType != null && 
multipartValidationPattern.matcher(contentType.toLowerCase(Locale.ENGLISH)).matches();
+
+        LOG.debug("Validating if this is proper Multipart request. Request is 
POST: {} and ContentType matches pattern ({}): {}",

Review Comment:
   ```suggestion
           LOG.debug("Validating if this is a proper Multipart request. Request 
is POST: {} and ContentType matches pattern ({}): {}",
   ```



##########
core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java:
##########
@@ -986,10 +986,12 @@ private void applyEncoding(HttpServletResponse response, 
String encoding) {
     public HttpServletRequest wrapRequest(HttpServletRequest request) throws 
IOException {
         // don't wrap more than once
         if (request instanceof StrutsRequestWrapper) {
+            LOG.debug("Request already wrapped with {}", 
StrutsRequestWrapper.class.getSimpleName());

Review Comment:
   ```suggestion
               LOG.debug("Request already wrapped with: {}", 
StrutsRequestWrapper.class.getSimpleName());
   ```
   
   to be consistent with other logs from this PR





Issue Time Tracking
-------------------

    Worklog Id:     (was: 908554)
    Time Spent: 0.5h  (was: 20m)

> Adds more logging statements around validating and accepting MultiPartRequest
> -----------------------------------------------------------------------------
>
>                 Key: WW-5401
>                 URL: https://issues.apache.org/jira/browse/WW-5401
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Lukasz Lenart
>            Assignee: Lukasz Lenart
>            Priority: Trivial
>             Fix For: 6.4.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently there is no logging at all in this area and it's hard to debug 
> what's wrong with file upload. See [the following 
> thread|https://lists.apache.org/thread/j278lv3m0mpd0qtdf0pc60sc4hbo7noy] on 
> the Users mailing list.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to