Avatar for the aio-libs user
aio-libs
aiohttp
BlogDocsChangelog

enforce rfc6455 section 4.2.1 requirement to refuse malformed Websocket handshake

#10729
Comparing
pajod:patch-1
(
14ed61f
) with
master
(
d912123
)
CodSpeed Performance Gauge
0%
Improvements
0
Regressions
0
Untouched
55
New
0
Dropped
0
Ignored
2

Benchmarks

Passed

test_simple_web_file_response[pyloop]
tests/test_benchmarks_web_fileresponse.py::test_simple_web_file_response[pyloop]
CodSpeed Performance Gauge
+1%
78.4 ms
77.6 ms
test_load_cookies_into_temp_cookiejar
tests/test_benchmarks_cookiejar.py::test_load_cookies_into_temp_cookiejar
CodSpeed Performance Gauge
+1%
198.8 µs
197 µs
test_serialize_headers
tests/test_benchmarks_http_writer.py::test_serialize_headers
CodSpeed Performance Gauge
+1%
855.2 µs
848.9 µs
test_send_one_hundred_websocket_text_messages_with_mask[pyloop]
tests/test_benchmarks_http_websocket.py::test_send_one_hundred_websocket_text_messages_with_mask[pyloop]
CodSpeed Performance Gauge
+1%
782.4 µs
777 µs
test_read_one_hundred_websocket_text_messages[pyloop]
tests/test_benchmarks_http_websocket.py::test_read_one_hundred_websocket_text_messages[pyloop]
CodSpeed Performance Gauge
+1%
259.5 µs
258 µs
test_send_one_hundred_websocket_text_messages[pyloop]
tests/test_benchmarks_http_websocket.py::test_send_one_hundred_websocket_text_messages[pyloop]
CodSpeed Performance Gauge
+1%
563.5 µs
560.2 µs
test_one_thousand_round_trip_websocket_text_messages[pyloop]
tests/test_benchmarks_client_ws.py::test_one_thousand_round_trip_websocket_text_messages[pyloop]
CodSpeed Performance Gauge
0%
17 ms
16.9 ms
test_one_hundred_get_requests_with_30000_chunked_payload[pyloop]
tests/test_benchmarks_client.py::test_one_hundred_get_requests_with_30000_chunked_payload[pyloop]
CodSpeed Performance Gauge
0%
40.5 ms
40.4 ms
test_resolve_prefix_resources_many_prefix_many_plain[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_prefix_resources_many_prefix_many_plain[pyloop]
CodSpeed Performance Gauge
0%
4.6 ms
4.6 ms
test_one_hundred_simple_get_requests[pyloop]
tests/test_benchmarks_client.py::test_one_hundred_simple_get_requests[pyloop]
CodSpeed Performance Gauge
0%
32.2 ms
32.2 ms
test_send_one_hundred_websocket_compressed_messages[zlib_ng.zlib_ng-pyloop]
tests/test_benchmarks_http_websocket.py::test_send_one_hundred_websocket_compressed_messages[zlib_ng.zlib_ng-pyloop]
CodSpeed Performance Gauge
0%
2.1 ms
2.1 ms
test_one_hundred_simple_get_requests_multiple_methods_route[pyloop]
tests/test_benchmarks_client.py::test_one_hundred_simple_get_requests_multiple_methods_route[pyloop]
CodSpeed Performance Gauge
0%
32 ms
31.9 ms
test_one_hundred_get_requests_with_30000_content_length_payload[pyloop]
tests/test_benchmarks_client.py::test_one_hundred_get_requests_with_30000_content_length_payload[pyloop]
CodSpeed Performance Gauge
0%
39.1 ms
39 ms
test_simple_web_file_sendfile_fallback_response[pyloop]
tests/test_benchmarks_web_fileresponse.py::test_simple_web_file_sendfile_fallback_response[pyloop]
CodSpeed Performance Gauge
0%
83.8 ms
83.6 ms
test_create_client_request_with_headers[pyloop]
tests/test_benchmarks_client_request.py::test_create_client_request_with_headers[pyloop]
CodSpeed Performance Gauge
0%
68.7 µs
68.6 µs
test_one_hundred_get_requests_with_1024_content_length_payload[pyloop]
tests/test_benchmarks_client.py::test_one_hundred_get_requests_with_1024_content_length_payload[pyloop]
CodSpeed Performance Gauge
0%
34.9 ms
34.8 ms
test_one_hundred_get_requests_with_1024_chunked_payload[pyloop]
tests/test_benchmarks_client.py::test_one_hundred_get_requests_with_1024_chunked_payload[pyloop]
CodSpeed Performance Gauge
0%
35.5 ms
35.4 ms
test_one_hundred_simple_post_requests[pyloop]
tests/test_benchmarks_client.py::test_one_hundred_simple_post_requests[pyloop]
CodSpeed Performance Gauge
0%
36.6 ms
36.5 ms
test_ten_streamed_responses_iter_any[pyloop]
tests/test_benchmarks_client.py::test_ten_streamed_responses_iter_any[pyloop]
CodSpeed Performance Gauge
0%
21.6 ms
21.6 ms
test_ten_web_middlewares[pyloop]
tests/test_benchmarks_web_middleware.py::test_ten_web_middlewares[pyloop]
CodSpeed Performance Gauge
0%
34.9 ms
34.9 ms
test_send_one_hundred_websocket_compressed_messages[isal.isal_zlib-pyloop]
tests/test_benchmarks_http_websocket.py::test_send_one_hundred_websocket_compressed_messages[isal.isal_zlib-pyloop]
CodSpeed Performance Gauge
0%
4.7 ms
4.7 ms
test_web_response_with_headers
tests/test_benchmarks_web_response.py::test_web_response_with_headers
CodSpeed Performance Gauge
0%
683.7 µs
683 µs
test_one_thousand_round_trip_websocket_binary_messages[pyloop]
tests/test_benchmarks_client_ws.py::test_one_thousand_round_trip_websocket_binary_messages[pyloop]
CodSpeed Performance Gauge
0%
16.5 ms
16.5 ms
test_one_hundred_get_requests_with_512kib_content_length_payload[pyloop]
tests/test_benchmarks_client.py::test_one_hundred_get_requests_with_512kib_content_length_payload[pyloop]
CodSpeed Performance Gauge
0%
164.4 ms
164.3 ms
test_ten_streamed_responses_iter_chunks[pyloop]
tests/test_benchmarks_client.py::test_ten_streamed_responses_iter_chunks[pyloop]
CodSpeed Performance Gauge
0%
16.1 ms
16.1 ms
test_read_large_binary_websocket_messages[pyloop]
tests/test_benchmarks_http_websocket.py::test_read_large_binary_websocket_messages[pyloop]
CodSpeed Performance Gauge
0%
9 ms
9 ms
test_simple_web_file_response_not_modified[pyloop]
tests/test_benchmarks_web_fileresponse.py::test_simple_web_file_response_not_modified[pyloop]
CodSpeed Performance Gauge
0%
54.9 ms
54.9 ms
test_send_one_hundred_websocket_compressed_messages[zlib-pyloop]
tests/test_benchmarks_http_websocket.py::test_send_one_hundred_websocket_compressed_messages[zlib-pyloop]
CodSpeed Performance Gauge
0%
3.1 ms
3.1 ms
test_get_request_with_251308_compressed_chunked_payload[zlib-pyloop]
tests/test_benchmarks_client.py::test_get_request_with_251308_compressed_chunked_payload[zlib-pyloop]
CodSpeed Performance Gauge
0%
426 ms
426 ms
test_resolve_dynamic_resource_url_with_many_static_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_dynamic_resource_url_with_many_static_routes[pyloop]
CodSpeed Performance Gauge
0%
3.6 ms
3.6 ms
test_ten_streamed_responses_iter_chunked_4096[pyloop]
tests/test_benchmarks_client.py::test_ten_streamed_responses_iter_chunked_4096[pyloop]
CodSpeed Performance Gauge
0%
27.9 ms
27.9 ms
test_one_thousand_large_round_trip_websocket_text_messages[pyloop]
tests/test_benchmarks_client_ws.py::test_one_thousand_large_round_trip_websocket_text_messages[pyloop]
CodSpeed Performance Gauge
0%
24.3 ms
24.3 ms
test_simple_web_response
tests/test_benchmarks_web_response.py::test_simple_web_response
CodSpeed Performance Gauge
0%
452.5 µs
453.2 µs
test_resolve_static_root_route[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_static_root_route[pyloop]
CodSpeed Performance Gauge
0%
979.6 µs
981.3 µs
test_one_hundred_json_post_requests[pyloop]
tests/test_benchmarks_client.py::test_one_hundred_json_post_requests[pyloop]
CodSpeed Performance Gauge
0%
38.3 ms
38.4 ms
test_resolve_dynamic_resource_url_with_many_dynamic_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_dynamic_resource_url_with_many_dynamic_routes[pyloop]
CodSpeed Performance Gauge
0%
3.5 ms
3.6 ms
test_ten_streamed_responses_iter_chunked_65536[pyloop]
tests/test_benchmarks_client.py::test_ten_streamed_responses_iter_chunked_65536[pyloop]
CodSpeed Performance Gauge
0%
22.9 ms
22.9 ms
test_client_request_update_cookies[pyloop]
tests/test_benchmarks_client_request.py::test_client_request_update_cookies[pyloop]
CodSpeed Performance Gauge
0%
168.1 µs
168.4 µs
test_get_request_with_251308_compressed_chunked_payload[zlib_ng.zlib_ng-pyloop]
tests/test_benchmarks_client.py::test_get_request_with_251308_compressed_chunked_payload[zlib_ng.zlib_ng-pyloop]
CodSpeed Performance Gauge
0%
235.8 ms
236.4 ms
test_simple_web_stream_response
tests/test_benchmarks_web_response.py::test_simple_web_stream_response
CodSpeed Performance Gauge
0%
246.1 µs
246.8 µs
test_web_response_with_text_body
tests/test_benchmarks_web_response.py::test_web_response_with_text_body
CodSpeed Performance Gauge
0%
666 µs
668.1 µs
test_resolve_gitapi_subapps[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_gitapi_subapps[pyloop]
CodSpeed Performance Gauge
0%
294.6 ms
295.7 ms
test_create_client_request_with_cookies[pyloop]
tests/test_benchmarks_client_request.py::test_create_client_request_with_cookies[pyloop]
CodSpeed Performance Gauge
0%
125.9 µs
126.3 µs
test_send_one_hundred_large_websocket_text_messages[pyloop]
tests/test_benchmarks_http_websocket.py::test_send_one_hundred_large_websocket_text_messages[pyloop]
CodSpeed Performance Gauge
0%
535.7 µs
537.8 µs
test_resolve_gitapi_root[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_gitapi_root[pyloop]
CodSpeed Performance Gauge
0%
2 ms
2 ms
test_web_response_with_bytes_body
tests/test_benchmarks_web_response.py::test_web_response_with_bytes_body
CodSpeed Performance Gauge
0%
549.9 µs
552.3 µs
test_get_request_with_251308_compressed_chunked_payload[isal.isal_zlib-pyloop]
tests/test_benchmarks_client.py::test_get_request_with_251308_compressed_chunked_payload[isal.isal_zlib-pyloop]
CodSpeed Performance Gauge
0%
70.3 ms
70.6 ms
test_resolve_gitapi[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_gitapi[pyloop]
CodSpeed Performance Gauge
0%
292.6 ms
293.9 ms
test_resolve_dynamic_resource_url_with_many_dynamic_routes_with_common_prefix[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_dynamic_resource_url_with_many_dynamic_routes_with_common_prefix[pyloop]
CodSpeed Performance Gauge
-1%
245.6 ms
246.9 ms
test_resolve_root_route_with_many_fixed_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_root_route_with_many_fixed_routes[pyloop]
CodSpeed Performance Gauge
-1%
873.7 µs
878.9 µs
test_resolve_single_fixed_url_with_many_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_single_fixed_url_with_many_routes[pyloop]
CodSpeed Performance Gauge
-1%
881.4 µs
887.3 µs
test_send_client_request_one_hundred[pyloop]
tests/test_benchmarks_client_request.py::test_send_client_request_one_hundred[pyloop]
CodSpeed Performance Gauge
-1%
2.4 ms
2.4 ms
test_resolve_multiple_level_fixed_url_with_many_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_multiple_level_fixed_url_with_many_routes[pyloop]
CodSpeed Performance Gauge
-1%
8.5 ms
8.6 ms
test_resolve_multiple_fixed_url_with_many_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_multiple_fixed_url_with_many_routes[pyloop]
CodSpeed Performance Gauge
-1%
2.2 ms
2.2 ms
test_resolve_root_route[pyloop]
tests/test_benchmarks_web_urldispatcher.py::test_resolve_root_route[pyloop]
CodSpeed Performance Gauge
-1%
872.6 µs
881.6 µs

Ignored

test_one_hundred_get_requests_iter_chunks_on_512kib_chunked_payload[pyloop]Ignored
tests/test_benchmarks_client.py::test_one_hundred_get_requests_iter_chunks_on_512kib_chunked_payload[pyloop]
CodSpeed Performance Gauge
0%
96.8 ms
96.8 ms
test_one_hundred_get_requests_with_512kib_chunked_payload[pyloop]Ignored
tests/test_benchmarks_client.py::test_one_hundred_get_requests_with_512kib_chunked_payload[pyloop]
CodSpeed Performance Gauge
0%
188.6 ms
188.5 ms

Commits

Click on a commit to change the comparison range
Base
master
d912123
0%
raise on misdirected websocket handshake Responding "HTTP/1.1 101 Switching Protocols" to a HEAD or POST request is unlikely intended. Spec says **"MUST stop"** for non-GET requests: https://datatracker.ietf.org/doc/html/rfc6455#section-4.2.1 There is precedent for being strict about 1xx informational responses that might confuse a proxy, see expect-100 processing.
14ed61f
29 days ago
by pajod
© 2025 CodSpeed Technology
Home Terms PrivacyDocs