| skipped 63 lines |
64 | 64 | | @Override |
65 | 65 | | public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) |
66 | 66 | | throws NoSuchAlgorithmException, IOException { |
67 | | - | if (headers.containsKey(WS_VERSION_KEY)) { |
| 67 | + | if (headers.containsKey(WS_VERSION_KEY.toUpperCase())) { |
68 | 68 | | return false; |
69 | 69 | | } |
70 | 70 | | |
71 | 71 | | byte[] secBufArr = new byte[16]; |
72 | | - | Long secKey1 = decodeHyxie76SecKey(headers.get(WS_KEY1_KEY)); |
73 | | - | Long secKey2 = decodeHyxie76SecKey(headers.get(WS_KEY2_KEY)); |
| 72 | + | Long secKey1 = decodeHyxie76SecKey(headers.get(WS_KEY1_KEY.toUpperCase())); |
| 73 | + | Long secKey2 = decodeHyxie76SecKey(headers.get(WS_KEY2_KEY.toUpperCase())); |
74 | 74 | | if (log.isLoggable(Level.FINEST)) { |
75 | 75 | | log.log(Level.FINEST, "WS-KEY1 = {0}", secKey1); |
76 | 76 | | log.log(Level.FINEST, "WS-KEY2 = {0}", secKey2); |
| skipped 15 lines |
92 | 92 | | |
93 | 93 | | response.append("Content-Length: ").append(resp.length).append("\r\n"); |
94 | 94 | | response.append(WS_PROTOCOL_KEY).append(": "); |
95 | | - | if (headers.get(WS_PROTOCOL_KEY).contains("xmpp-framing")) { |
| 95 | + | if (headers.get(WS_PROTOCOL_KEY.toUpperCase()).contains("xmpp-framing")) { |
96 | 96 | | response.append("xmpp-framing"); |
97 | 97 | | } else { |
98 | 98 | | response.append("xmpp"); |
99 | 99 | | } |
100 | 100 | | response.append("\r\n"); |
101 | | - | if (headers.containsKey(ORIGIN_KEY)) { |
102 | | - | response.append(WS_ORIGIN_KEY).append(": ").append(headers.get(ORIGIN_KEY)).append("\r\n"); |
| 101 | + | if (headers.containsKey(ORIGIN_KEY.toUpperCase())) { |
| 102 | + | response.append(WS_ORIGIN_KEY).append(": ").append(headers.get(ORIGIN_KEY.toUpperCase())).append("\r\n"); |
103 | 103 | | } |
104 | 104 | | |
105 | 105 | | boolean ssl = SocketType.ssl == ((SocketType) service.getSessionData().get("socket")); |
106 | 106 | | int localPort = service.getLocalPort(); |
107 | | - | String location = (ssl ? "wss://" : "ws://") + headers.get(HOST_KEY) + |
108 | | - | (((ssl && localPort == 443) || (!ssl && localPort == 80) || headers.get(HOST_KEY).contains(":")) |
| 107 | + | String location = (ssl ? "wss://" : "ws://") + headers.get(HOST_KEY.toUpperCase()) + |
| 108 | + | (((ssl && localPort == 443) || (!ssl && localPort == 80) || headers.get(HOST_KEY.toUpperCase()).contains(":")) |
109 | 109 | | ? "" |
110 | 110 | | : (":" + localPort)) + "/"; |
111 | 111 | | response.append(WS_LOCATION_KEY).append(": ").append(location).append("\r\n"); |
| skipped 153 lines |