You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2022/06/15 09:08:04 UTC

[struts] 03/03: WW-5190 Uses wrapped request only when processing request by Struts

This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-5190-match-action-proxy
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 69102e907551a87335231656320c8484072bdecb
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Wed Jun 15 11:07:53 2022 +0200

    WW-5190 Uses wrapped request only when processing request by Struts
---
 .../struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter.java b/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter.java
index 73f5860ec..54ee6883d 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter.java
@@ -126,18 +126,18 @@ public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
                 LOG.trace("Checking if {} is a static resource", uri);
                 boolean handled = execute.executeStaticResourceRequest(request, response);
                 if (!handled) {
-                    LOG.trace("Assuming uri {} as a normal action", uri);
+                    LOG.trace("Uri {} is not a static resource, assuming action", uri);
                     prepare.setEncodingAndLocale(request, response);
                     prepare.createActionContext(request, response);
                     prepare.assignDispatcherToThread();
-                    request = prepare.wrapRequest(request);
-                    ActionMapping mapping = prepare.findActionMapping(request, response, true);
+                    HttpServletRequest wrappedRequest = prepare.wrapRequest(request);
+                    ActionMapping mapping = prepare.findActionMapping(wrappedRequest, response, true);
                     if (mapping == null) {
                         LOG.trace("Cannot find mapping for {}, passing to other filters", uri);
                         chain.doFilter(request, response);
                     } else {
                         LOG.trace("Found mapping {} for {}", mapping, uri);
-                        execute.executeAction(request, response, mapping);
+                        execute.executeAction(wrappedRequest, response, mapping);
                     }
                 }
             }