Skip to content

Commit 57dad63

Browse files
committed
docs(http.server): mention exceptions for content length header
1 parent b70d45a commit 57dad63

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Doc/library/http.server.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ provides three different variants:
164164
capabilities for future requests. If set to
165165
``'HTTP/1.1'``, the server will permit HTTP persistent connections;
166166
however, your server *must* then include an accurate ``Content-Length``
167-
header (using :meth:`send_header`) in all of its responses to clients.
167+
header (using :meth:`send_header`) in all of its responses to clients
168+
(with a few exceptions, like the ``1xx`` and ``204`` status codes [#]_).
168169
For backwards compatibility, the setting defaults to ``'HTTP/1.0'``.
169170

170171
.. attribute:: MessageClass
@@ -562,3 +563,8 @@ server to send nefarious control codes to your terminal.
562563

563564
.. versionchanged:: 3.12
564565
Control characters are scrubbed in stderr logs.
566+
567+
.. rubric:: Footnotes
568+
569+
.. [#] Read more about the ``Content-Length`` header in the relevant RFC:
570+
https://www.rfc-editor.org/rfc/rfc9110#section-8.6

0 commit comments

Comments
 (0)