Mercurial > prosody-hg
comparison net/websocket.lua @ 14195:8d726f5d044a 13.0
net.websocket: Fix traceback in client if server doesn't respond with Connection header
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 26 May 2026 12:26:59 +0100 |
| parents | ba409c67353b |
| children |
comparison
equal
deleted
inserted
replaced
| 14194:159047a453f2 | 14195:8d726f5d044a |
|---|---|
| 238 headers = headers; | 238 headers = headers; |
| 239 sslctx = ex.sslctx; | 239 sslctx = ex.sslctx; |
| 240 insecure = ex.insecure; | 240 insecure = ex.insecure; |
| 241 }, function(b, c, r, http_req) | 241 }, function(b, c, r, http_req) |
| 242 if c ~= 101 | 242 if c ~= 101 |
| 243 or r.headers["connection"]:lower() ~= "upgrade" | 243 or (r.headers["connection"] or ""):lower() ~= "upgrade" |
| 244 or r.headers["upgrade"] ~= "websocket" | 244 or r.headers["upgrade"] ~= "websocket" |
| 245 or r.headers["sec-websocket-accept"] ~= base64.encode(sha1(key .. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")) | 245 or r.headers["sec-websocket-accept"] ~= base64.encode(sha1(key .. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")) |
| 246 or (protocol and not protocol[r.headers["sec-websocket-protocol"]]) | 246 or (protocol and not protocol[r.headers["sec-websocket-protocol"]]) |
| 247 then | 247 then |
| 248 s.readyState = 3; | 248 s.readyState = 3; |
