From f20dfca0d593568e5f938edf52c4043efa22add1 Mon Sep 17 00:00:00 2001 From: pgjones Date: Thu, 23 Dec 2021 16:39:08 +0000 Subject: [PATCH] Expand the allowed status codes to 999 The standard is often interpreted as allowing any three digit status code and hence h11 not supporting larger codes results in incompatibities. --- h11/_events.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/h11/_events.py b/h11/_events.py index ebbf10f..d7eac23 100644 --- a/h11/_events.py +++ b/h11/_events.py @@ -222,7 +222,7 @@ class Response(_ResponseBase): The status code of this response, as an integer. For an :class:`Response`, this is always in the range [200, - 600). + 1000). .. attribute:: headers @@ -243,9 +243,9 @@ class Response(_ResponseBase): """ def __post_init__(self) -> None: - if not (200 <= self.status_code < 600): + if not (200 <= self.status_code < 1000): raise LocalProtocolError( - "Response status_code should be in range [200, 600), not {}".format( + "Response status_code should be in range [200, 1000), not {}".format( self.status_code ) )