bdelacretaz commented on a change in pull request #20:
URL:
https://github.com/apache/sling-org-apache-sling-engine/pull/20#discussion_r708095210
##########
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:
While you're here, could you also add a comment on setStatus that not
throwing an exception if the response is already committed is non-standard? See
https://issues.apache.org/jira/browse/SLING-7813 for details
--
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]