[ 
https://issues.apache.org/jira/browse/WICKET-7205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18112970#comment-18112970
 ] 

ASF GitHub Bot commented on WICKET-7205:
----------------------------------------

hosea commented on code in PR #1581:
URL: https://github.com/apache/wicket/pull/1581#discussion_r3961467800


##########
wicket-core-tests/src/test/java/org/apache/wicket/csp/CSPHeaderWriterTest.java:
##########
@@ -115,6 +123,53 @@ void addCspDirectiveToStatelessPageAfterNoRedirect()
                        STYLE_SRC.getValue());
        }
 
+       @Test
+       void 
addCspDirectiveToStatelessPageEvenIfWrappedInMultipleIRequestHandlerDelegates()
+       {
+               tester.getApplication().mount(new 
MountedMapper("withdelegate/page", NoopMockPage.class)
+               {
+                       @Override
+                       public IRequestHandler mapRequest(final Request request)
+                       {
+                               final IRequestHandler requestHandler = 
super.mapRequest(request);
+                               final IRequestHandler result;
+                               if (requestHandler instanceof 
RenderPageRequestHandler renderPageRequestHandler && 
NoopMockPage.class.equals(renderPageRequestHandler.getPageClass()))

Review Comment:
   @pedrosans: Thank you for review. You are right. I simplified the test.





> CSP-Headers not set if RenderPageRequestHandler wrapped in more than one 
> IRequestHandlerDelegates
> -------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-7205
>                 URL: https://issues.apache.org/jira/browse/WICKET-7205
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 10.10.0, 10.11.0
>            Reporter: Hans Schäfer
>            Priority: Blocker
>
> If a RenderPageRequestHandler is wrapped in more than one 
> IRequestHandlerDelegate, the unwrap-Method of IRequestHandlerDelegates does 
> not return the RenderPageRequestHandler but a IRequestHandlerDelegates as it 
> unwraps only the first one.
> This leads to not rendered CSPs.
>  



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

Reply via email to