Skip to content

Commit 441ce56

Browse files
authored
Update ResponseStatus to conditionally set content type for error handling (#1261)
fixes SITES-28442
1 parent 39638e9 commit 441ce56

File tree

1 file changed

+7
-3
lines changed
  • src/main/archetype/ui.apps/src/main/content/jcr_root/apps/sling/servlet/errorhandler

1 file changed

+7
-3
lines changed

src/main/archetype/ui.apps/src/main/content/jcr_root/apps/sling/servlet/errorhandler/ResponseStatus.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717

1818
import com.adobe.cq.sightly.WCMUsePojo;
1919

20+
import javax.servlet.RequestDispatcher;
21+
2022
public class ResponseStatus extends WCMUsePojo {
21-
23+
2224
@Override
2325
public void activate() throws Exception {
2426
getResponse().setStatus(404);
25-
getResponse().setContentType("text/html");
27+
if (getRequest().getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH) == null) {
28+
getResponse().setContentType("text/html");
29+
}
2630
}
27-
}
31+
}

0 commit comments

Comments
 (0)