Skip to content

Commit

Permalink
Update ResponseStatus to conditionally set content type for error han…
Browse files Browse the repository at this point in the history
…dling

fixes SITES-28442
  • Loading branch information
bpauli committed Jan 31, 2025
1 parent 39638e9 commit 5022ee5
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@

import com.adobe.cq.sightly.WCMUsePojo;

import javax.servlet.RequestDispatcher;

public class ResponseStatus extends WCMUsePojo {

@Override
public void activate() throws Exception {
getResponse().setStatus(404);
getResponse().setContentType("text/html");
if (getRequest().getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH) == null) {
getResponse().setContentType("text/html");
}
}
}
}

0 comments on commit 5022ee5

Please sign in to comment.