Bug 58166 - Tomcat does not support application-specific close codes
Tomcat does not support application-specific close codes
Product: Tomcat 8
Classification: Unclassified
Component: WebSocket
PC All
: P2 minor (vote)
: ----
Assigned To: Tomcat Developers Mailing List
Depends on:
  Show dependency tree
Reported: 2015-07-21 16:00 UTC by Barry Coughlan
Modified: 2015-08-04 13:24 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Barry Coughlan 2015-07-21 16:00:05 UTC
org.apache.tomcat.websocket.Util.getCloseCode() converts codes between 3000 and 4999 to 1000. This behaviour is non-standard and differs from the behaviour of javax.websocket.CloseReason$CloseCodes which returns the correct close codes.

            return new CloseReason.CloseCode() {
                public int getCode() {
                    return code;
Comment 1 Mark Thomas 2015-08-04 13:24:49 UTC
Thanks for the report. This has been fixed in trunk, 8.0.x (for 8.0.25 onwards) and 7.0x. (for 7.0.64 onwards).