joerghoh commented on a change in pull request #20:
URL: 
https://github.com/apache/sling-org-apache-sling-engine/pull/20#discussion_r708105777



##########
File path: 
src/main/java/org/apache/sling/engine/impl/SlingHttpServletResponseImpl.java
##########
@@ -150,11 +150,12 @@ public void setStatus(final int sc, final String msg) {
                 LOG.warn("Response already committed. Failed to set status 
code from {} to {}. {}",
                         getStatus(), sc, explanation);
             }
-        }
-        if (msg == null) {
-            super.setStatus(sc);
-        } else {
-            super.setStatus(sc, msg);
+        } else { // response is not yet committed, so the statuscode can be 
changed

Review comment:
       The [Servlet 
API](https://javadoc.io/doc/javax.servlet/javax.servlet-api/3.1.0/javax/servlet/http/HttpServletResponse.html#setStatus(int))
 does not mention any exception in the signature of ```setStatus```, so my 
understanding is that this behavior is fully compliant to the standard.




-- 
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