(protocols='')
| 22 | |
| 23 | |
| 24 | def gen_ws_headers(protocols=''): |
| 25 | key = base64.b64encode(os.urandom(16)).decode() |
| 26 | hdrs = [('UPGRADE', 'websocket'), |
| 27 | ('CONNECTION', 'upgrade'), |
| 28 | ('SEC-WEBSOCKET-VERSION', '13'), |
| 29 | ('SEC-WEBSOCKET-KEY', key)] |
| 30 | if protocols: |
| 31 | hdrs += [('SEC-WEBSOCKET-PROTOCOL', protocols)] |
| 32 | return hdrs, key |
| 33 | |
| 34 | |
| 35 | def test_not_get(message, transport): |
no test coverage detected