예제 #1
0
 def test_response_invalid_accept(self):
     with self.assertInvalidResponseHeaders(InvalidHeaderValue) as headers:
         del headers["Sec-WebSocket-Accept"]
         other_key = "1Eq4UDEFQYg3YspNgqxv5g=="
         headers["Sec-WebSocket-Accept"] = accept(other_key)
예제 #2
0
 def test_response_invalid_accept(self):
     with self.assert_invalid_response_headers() as headers:
         other_key = "1Eq4UDEFQYg3YspNgqxv5g=="
         headers['Sec-WebSocket-Accept'] = accept(other_key)
예제 #3
0
 def test_accept(self):
     # Test vector from RFC 6455
     key = "dGhlIHNhbXBsZSBub25jZQ=="
     acc = "s3pPLMBiTxaQ9kYGzzhZRbK+xOo="
     self.assertEqual(accept(key), acc)
예제 #4
0
파일: verktyg.py 프로젝트: keis/lera
 def handshake(self, req, res):
     key = handshake.check_request(req.headers.__getitem__)
     res.headers['Transfer-Encoding'] = 'chunked'
     res.headers['Sec-Websocket-Accept'] = handshake.accept(key)
     return key