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

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

                Author: ASF GitHub Bot
            Created on: 18/Jan/24 09:32
            Start Date: 18/Jan/24 09:32
    Worklog Time Spent: 10m 
      Work Description: kusalk commented on code in PR #845:
URL: https://github.com/apache/struts/pull/845#discussion_r1457166934


##########
core/src/main/java/org/apache/struts2/interceptor/csp/CspInterceptor.java:
##########
@@ -99,8 +105,22 @@ private Optional<URI> buildUri(String reportUri) {
         }
     }
 
-    public void setEnforcingMode(String value) {
-        this.enforcingMode = Boolean.parseBoolean(value);
+    /**
+     * Enables enforcing mode, by default all exceptions are only reported
+     *
+     * @param enforcingMode <tt>true</tt> to enable enforcing mode, 
<tt>false</tt> to keep reporting mode.
+     */
+    public void setEnforcingMode(boolean enforcingMode) {
+        this.enforcingMode = enforcingMode;
+    }
+
+    /**
+     * Sets whether to prepend the servlet context path to the {@link 
#reportUri}.
+     *
+     * @param prependServletContext true</tt> to prepend the location with the 
servlet context path, <tt>false</tt> otherwise.

Review Comment:
   Missing an opening tag, but also <tt> is mostly unsupported these days



##########
core/src/main/java/org/apache/struts2/interceptor/csp/CspInterceptor.java:
##########
@@ -99,8 +105,22 @@ private Optional<URI> buildUri(String reportUri) {
         }
     }
 
-    public void setEnforcingMode(String value) {
-        this.enforcingMode = Boolean.parseBoolean(value);
+    /**
+     * Enables enforcing mode, by default all exceptions are only reported
+     *
+     * @param enforcingMode <tt>true</tt> to enable enforcing mode, 
<tt>false</tt> to keep reporting mode.
+     */
+    public void setEnforcingMode(boolean enforcingMode) {
+        this.enforcingMode = enforcingMode;
+    }
+
+    /**
+     * Sets whether to prepend the servlet context path to the {@link 
#reportUri}.
+     *
+     * @param prependServletContext true</tt> to prepend the location with the 
servlet context path, <tt>false</tt> otherwise.

Review Comment:
   Missing an opening tag, but also `<tt>` is mostly unsupported these days





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

    Worklog Id:     (was: 900371)
    Time Spent: 50m  (was: 40m)

> CspInterceptor reportUri with context
> -------------------------------------
>
>                 Key: WW-5374
>                 URL: https://issues.apache.org/jira/browse/WW-5374
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Interceptors
>    Affects Versions: 6.3.0
>            Reporter: Andreas Sachs
>            Priority: Major
>             Fix For: 6.4.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> At the moment the reportURI has to start with a schema (http, https) or with 
> "/". But how can i add the context to the url?
>  
> Example:
> Action: /report.action
> Application running in context "showcase".
> Complete URL: [http://example.com/showcase/report.action]
>  
> That means, that in the configuration i have to set reportUri = 
> /showcase/report.action. But the context should not be hardcoded in struts.xml
>  
> Is there a parameter for the context?
>  
> I would prefer the solution from ServletRedirectResult: an option to add the 
> context (PrependServletContext)
>  
>  
>  
>  



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

Reply via email to