lkrapf commented on code in PR #82:
URL: 
https://github.com/apache/sling-org-apache-sling-engine/pull/82#discussion_r3911563730


##########
src/main/java/org/apache/sling/engine/impl/SlingJakartaHttpServletResponseImpl.java:
##########
@@ -510,6 +542,7 @@ public void sendError(int status) throws IOException {
     @Override
     public void sendError(int status, String message) throws IOException {
         if (!this.isProtectHeadersOnInclude()) {
+            logHeaderModificationCallOnIncludeForMethod("setError()");

Review Comment:
   s/setError/sendError/g



##########
src/main/java/org/apache/sling/engine/impl/SlingJakartaHttpServletResponseImpl.java:
##########
@@ -492,6 +507,23 @@ private String getMessage(@Nullable String 
currentContentType, @Nullable String
                 allMessages);
     }
 
+    /**
+     * log a message for calling a header-modifying API when called as part of 
an include
+     * @param method the name of the method
+     */
+    private void logHeaderModificationCallOnIncludeForMethod(String method) {
+        if (isInclude()) {
+            String msg = String.format(
+                    "Calling '%s' within an include is not compliant to the 
Servlet spec (see SLING-13222)", method);

Review Comment:
   s/SLING-13222/SLING-13322/g
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to