Skip to content

Commit

Permalink
[WICKET-7067] WebSocketResponse does not allow setting a header thus,…
Browse files Browse the repository at this point in the history
… disableCaching fails with an UnsupportedOperationException
  • Loading branch information
reiern70 committed Aug 18, 2023
1 parent 2a84915 commit 4999c67
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4999c67

Please sign in to comment.