[
https://issues.apache.org/jira/browse/SLING-13349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Carsten Ziegeler updated SLING-13349:
-------------------------------------
Description:
According to the [servlet api
specification|https://jakarta.ee/specifications/servlet/6.0/jakarta-servlet-spec-6.0#the-include-method],
the include servlet:
{noformat}
cannot set headers or call any method that affects the headers of the
response{noformat}
This means that methods like sendError() and sendRedirect() are not allowed to
be used during an include. Those methods change the status and commit the
response, which both are headers being changed. As well as resetting the
response, which changes headers like content type back to null.
Additionally all other header-modifying operations (setHeader, setContentType,
...) should not be allowed.
The reference implementation ignores sendError/sendRedirect on an include, see
e.g.
[https://github.com/apache/tomcat/blob/main/java/org/apache/catalina/connector/Response.java#L1198]
. Thats what we need to do as well.
was:
According to the [servlet api
specification|https://jakarta.ee/specifications/servlet/6.0/jakarta-servlet-spec-6.0#the-include-method],
the include servlet:
{noformat}
cannot set headers or call any method that affects the headers of the
response{noformat}
This means that methods like sendError() and sendRedirect() are not allowed to
be used during an include. Those methods change the status and commit the
response, which both are headers being changed. As well as resetting the
response, which changes headers like content type back to null.
Additionally all other header-modifying operations (setHeader, setContentType,
...) should not be allowed.
> Correctly handle response header modifying operations during include
> --------------------------------------------------------------------
>
> Key: SLING-13349
> URL: https://issues.apache.org/jira/browse/SLING-13349
> Project: Sling
> Issue Type: Bug
> Components: Engine
> Affects Versions: Engine 3.0.0, Engine 2.16.6
> Reporter: Remo Liechti
> Assignee: Joerg Hoh
> Priority: Major
>
> According to the [servlet api
> specification|https://jakarta.ee/specifications/servlet/6.0/jakarta-servlet-spec-6.0#the-include-method],
> the include servlet:
> {noformat}
> cannot set headers or call any method that affects the headers of the
> response{noformat}
> This means that methods like sendError() and sendRedirect() are not allowed
> to be used during an include. Those methods change the status and commit the
> response, which both are headers being changed. As well as resetting the
> response, which changes headers like content type back to null.
> Additionally all other header-modifying operations (setHeader,
> setContentType, ...) should not be allowed.
>
> The reference implementation ignores sendError/sendRedirect on an include,
> see e.g.
> [https://github.com/apache/tomcat/blob/main/java/org/apache/catalina/connector/Response.java#L1198]
> . Thats what we need to do as well.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)