You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if not header["connection"] or header["connection"]:lower() ~= "upgrade" then
return 400, "Connection must Upgrade"
end
从客户端发过来的请求头部信息来看,“Connection”参数的值为“keep-alive, Upgrade”,而websoket.lua模块的校验条件判断是“if not header["connection"] or header["connection"]:lower() ~= "upgrade" then”,也就是说客户端发过来的消息请求头部的“Connection”参数的值为“keep-alive, Upgrade”就不可能通过这个条件判断,因为这个条件判断是header["connection"]:lower() ~= "upgrade" 。
希望官方修复下这个问题,不然可能导致有些websocket客户端连接在握手时失败。
目前我这边的做法是把if not header["connection"] or header["connection"]:lower() ~= "upgrade" then判断条件改成了:if not header["connection"] or not header["connection"]:lower():find("upgrade", 1,true) then @cloudwu@lvzixun@shuax
The text was updated successfully, but these errors were encountered:
接收客户端发过来的请求信息如下:
而skynet的websocket.lua模块的101~103行校验header头部信息代码如下:
从客户端发过来的请求头部信息来看,“Connection”参数的值为“keep-alive, Upgrade”,而websoket.lua模块的校验条件判断是“if not header["connection"] or header["connection"]:lower() ~= "upgrade" then”,也就是说客户端发过来的消息请求头部的“Connection”参数的值为“keep-alive, Upgrade”就不可能通过这个条件判断,因为这个条件判断是header["connection"]:lower() ~= "upgrade" 。
希望官方修复下这个问题,不然可能导致有些websocket客户端连接在握手时失败。
目前我这边的做法是把if not header["connection"] or header["connection"]:lower() ~= "upgrade" then判断条件改成了:if not header["connection"] or not header["connection"]:lower():find("upgrade", 1,true) then
@cloudwu @lvzixun @shuax
The text was updated successfully, but these errors were encountered: