From 62928ddbcdc910b8ad9a6492c63dc6d2de5b35a0 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 21 Feb 2015 00:20:30 +0900 Subject: [PATCH] python: Remove validation offered by nghttp2 lib --- python/nghttp2.pyx | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/python/nghttp2.pyx b/python/nghttp2.pyx index 594f44ad..ad91df20 100644 --- a/python/nghttp2.pyx +++ b/python/nghttp2.pyx @@ -400,12 +400,6 @@ cdef int server_on_frame_recv(cnghttp2.nghttp2_session *session, handler = _get_stream_user_data(session, frame.hd.stream_id) if not handler: return 0 - # Check required header fields. We expect that :authority - # or host header field. - if handler.scheme is None or handler.method is None or\ - handler.host is None or handler.path is None: - return http2._rst_stream(frame.hd.stream_id, - cnghttp2.NGHTTP2_PROTOCOL_ERROR) if handler.cookies: handler.headers.append((b'cookie', b'; '.join(handler.cookies))) @@ -556,10 +550,7 @@ cdef int client_on_frame_recv(cnghttp2.nghttp2_session *session, if not handler: return 0 - # Check required header fields. We expect a status. - if handler.status is None: - return http2._rst_stream(frame.hd.stream_id, - cnghttp2.NGHTTP2_PROTOCOL_ERROR) + # TODO handle 1xx non-final response if handler.cookies: handler.headers.append((b'cookie', b'; '.join(handler.cookies))) @@ -587,10 +578,6 @@ cdef int client_on_frame_recv(cnghttp2.nghttp2_session *session, cnghttp2.nghttp2_session_set_stream_user_data(session, frame.push_promise.promised_stream_id, NULL) - if push_handler.scheme is None or push_handler.method is None or\ - push_handler.host is None or push_handler.path is None: - return http2._rst_stream(frame.push_promise.promised_stream_id, - cnghttp2.NGHTTP2_PROTOCOL_ERROR) try: handler.on_push_promise(push_handler) except: