From 7153b804755cee2454e0e4221aaa6e70646a3ecb Mon Sep 17 00:00:00 2001 From: alimcmaster1 Date: Fri, 28 Feb 2020 01:14:52 +0000 Subject: [PATCH 1/2] Add http status code 103 Early Hints --- Doc/library/http.rst | 4 ++++ Lib/http/__init__.py | 1 + Lib/test/test_httplib.py | 1 + .../next/Library/2020-02-28-01-11-15.bpo39780.quT78n.rst | 2 ++ 4 files changed, 8 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2020-02-28-01-11-15.bpo39780.quT78n.rst diff --git a/Doc/library/http.rst b/Doc/library/http.rst index 0e3441cbcb718c..0494efe47cc769 100644 --- a/Doc/library/http.rst +++ b/Doc/library/http.rst @@ -62,6 +62,7 @@ Code Enum Name Details ``100`` ``CONTINUE`` HTTP/1.1 :rfc:`7231`, Section 6.2.1 ``101`` ``SWITCHING_PROTOCOLS`` HTTP/1.1 :rfc:`7231`, Section 6.2.2 ``102`` ``PROCESSING`` WebDAV :rfc:`2518`, Section 10.1 +``103`` ``EARLY_HINT`` An HTTP Status Code for Indicating Hints :rfc:`8297` ``200`` ``OK`` HTTP/1.1 :rfc:`7231`, Section 6.3.1 ``201`` ``CREATED`` HTTP/1.1 :rfc:`7231`, Section 6.3.2 ``202`` ``ACCEPTED`` HTTP/1.1 :rfc:`7231`, Section 6.3.3 @@ -130,3 +131,6 @@ equal to the constant name (i.e. ``http.HTTPStatus.OK`` is also available as .. versionadded:: 3.8 Added ``451 UNAVAILABLE_FOR_LEGAL_REASONS`` status code. + +.. versionchanged:: 3.9 + Added ``103 Early Hints`` status code. diff --git a/Lib/http/__init__.py b/Lib/http/__init__.py index 350afe77926b02..359a440270c816 100644 --- a/Lib/http/__init__.py +++ b/Lib/http/__init__.py @@ -31,6 +31,7 @@ def __new__(cls, value, phrase, description=''): SWITCHING_PROTOCOLS = (101, 'Switching Protocols', 'Switching to new protocol; obey Upgrade header') PROCESSING = 102, 'Processing' + EARLY_HINTS = 103, 'Early Hints' # success OK = 200, 'OK', 'Request fulfilled, document follows' diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index e1aa41421febf4..9de0dc2c3dd48d 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -1388,6 +1388,7 @@ def test_client_constants(self): 'CONTINUE', 'SWITCHING_PROTOCOLS', 'PROCESSING', + 'EARLY_HINTS', 'OK', 'CREATED', 'ACCEPTED', diff --git a/Misc/NEWS.d/next/Library/2020-02-28-01-11-15.bpo39780.quT78n.rst b/Misc/NEWS.d/next/Library/2020-02-28-01-11-15.bpo39780.quT78n.rst new file mode 100644 index 00000000000000..3ee9bd4f03edde --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-02-28-01-11-15.bpo39780.quT78n.rst @@ -0,0 +1,2 @@ +Added a new status code to the http module: 103 +EARLY_HINTS \ No newline at end of file From fb85d809bc61eba1a41c754165432a71da8479be Mon Sep 17 00:00:00 2001 From: alimcmaster1 Date: Fri, 28 Feb 2020 01:37:24 +0000 Subject: [PATCH 2/2] Add http status code 103 Early Hints --- ...o39780.quT78n.rst => 2020-02-28-01-11-15.bpo-39780.quT78n.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Misc/NEWS.d/next/Library/{2020-02-28-01-11-15.bpo39780.quT78n.rst => 2020-02-28-01-11-15.bpo-39780.quT78n.rst} (100%) diff --git a/Misc/NEWS.d/next/Library/2020-02-28-01-11-15.bpo39780.quT78n.rst b/Misc/NEWS.d/next/Library/2020-02-28-01-11-15.bpo-39780.quT78n.rst similarity index 100% rename from Misc/NEWS.d/next/Library/2020-02-28-01-11-15.bpo39780.quT78n.rst rename to Misc/NEWS.d/next/Library/2020-02-28-01-11-15.bpo-39780.quT78n.rst