Bug 58166

Summary: Tomcat does not support application-specific close codes
Product: Tomcat 8 Reporter: Barry Coughlan <b.coughlan2>
Component: WebSocketAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: 8.0.x-trunk   
Target Milestone: ----   
Hardware: PC   
OS: All   

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() {
                @Override
                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).