diff --git a/wicket-core/src/main/java/org/apache/wicket/DefaultExceptionMapper.java b/wicket-core/src/main/java/org/apache/wicket/DefaultExceptionMapper.java index a26a882c43e..54346d587ef 100644 --- a/wicket-core/src/main/java/org/apache/wicket/DefaultExceptionMapper.java +++ b/wicket-core/src/main/java/org/apache/wicket/DefaultExceptionMapper.java @@ -54,10 +54,11 @@ public IRequestHandler map(Exception e) try { Response response = RequestCycle.get().getResponse(); - if (response instanceof WebResponse) + // WICKET-7067 WebSocketResponse doesn't allow setting headers + if (response instanceof WebResponse && ((WebResponse) response).isHeaderSupported()) { // we don't want to cache an exceptional reply in the browser - ((WebResponse)response).disableCaching(); + ((WebResponse) response).disableCaching(); } return internalMap(e); }