[ https://issues.apache.org/jira/browse/WICKET-7075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17767027#comment-17767027 ]
ASF subversion and git services commented on WICKET-7075: --------------------------------------------------------- Commit de89eb6a2db7fd25ca164e383daee38fa1053448 in wicket's branch refs/heads/master from Jeroen Steenbeeke [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=de89eb6a2d ] WICKET-7075: Headers require uncommitted response (#652) CrossOriginOpenerPolicyRequestCycleListener attempts to write headers to a response that is already committed. It contains logic to prevent setting of headers when a response does not support them, but the implementation for ServletWebResponse always returns true. This commit modifies ServletWebResponse to check if the underlying HttpServletResponse has already been committed. > ServletWebResponse allows writing headers to committed HttpServletResponse > -------------------------------------------------------------------------- > > Key: WICKET-7075 > URL: https://issues.apache.org/jira/browse/WICKET-7075 > Project: Wicket > Issue Type: Bug > Components: wicket-core > Affects Versions: 10.0.0-M1 > Environment: Jetty 12 > Reporter: Jeroen Steenbeeke > Priority: Minor > > h2. Background > I'm in the progress of migrating a number of Wicket projects to Jakarta > namespaced libraries. Due to dependencies outside of Wicket requiring Servlet > API version 6, I ended up using Jetty 12 as a servlet container. > h2. Problem > When running on Jetty 12, {{CrossOriginOpenerPolicyRequestCycleListener}} > attempts to set headers on a response that has already been committed, > resulting in an {{{}UnsupportedOperationException{}}}. > This does not appear to affect the application's basic operation, other than > polluting the logs with stacktraces. > h2. Proposed solution > The current implementation of {{CrossOriginOpenerPolicyRequestCycleListener}} > already checks the {{{}WebResponse{}}}'s {{isHeaderSupported}} method to see > if headers can be set, but the implementation of {{ServletWebResponse}} > always returns true. By modifying this implementation to check the underlying > {{HttpServletResponse}} if the response has been committed we can make this > check work as intended. > I have submitted a [PR|https://github.com/apache/wicket/pull/652] for this > solution. -- This message was sent by Atlassian Jira (v8.20.10#820010)