提交 8599940b 编写于 作者: 如梦技术's avatar 如梦技术 🐛

代码优化,减少 codacy 上的问题。

上级 197d256b
......@@ -467,7 +467,7 @@ public class MqttWebServerAioHandler implements ServerAioHandler {
* @return HttpResponse
* @author tanyaowu
*/
public HttpResponse updateWebSocketProtocol(HttpRequest request) {
public HttpResponse updateWebSocketProtocol(HttpRequest request) throws TioDecodeException {
Map<String, String> headers = request.getHeaders();
String secWebSocketKey = headers.get(HttpConst.RequestHeaderKey.Sec_WebSocket_Key);
if (StrUtil.isNotBlank(secWebSocketKey)) {
......@@ -475,7 +475,7 @@ public class MqttWebServerAioHandler implements ServerAioHandler {
try {
secWebSocketKeyBytes = secWebSocketKey.getBytes(request.getCharset());
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
throw new TioDecodeException(e);
}
byte[] allBs = new byte[secWebSocketKeyBytes.length + SEC_WEBSOCKET_KEY_SUFFIX_BYTES.length];
System.arraycopy(secWebSocketKeyBytes, 0, allBs, 0, secWebSocketKeyBytes.length);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册