8000 Proposal for an update of the http.server module documentation · python/cpython@294e164 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 294e164

Browse files
author
Pierre Quentel
committed
Proposal for an update of the http.server module documentation
1 parent 3cc4f6d commit 294e164

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Doc/library/http.server.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,13 @@ of which this module provides three different variants:
343343
:func:`os.listdir` to scan the directory, and returns a ``404`` error
344344
response if the :func:`~os.listdir` fails.
345345

346-
If the request was mapped to a file, it is opened and the contents are
347-
returned. Any :exc:`OSError` exception in opening the requested file is
348-
mapped to a ``404``, ``'File not found'`` error. Otherwise, the content
346+
If the request was mapped to a file, it is opened. Any :exc:`OSError`
347+
exception in opening the requested file is mapped to a ``404``,
348+
``'File not found'`` error. If there was a ``'If-Modified-Since'``
349+
header in the request, and the file was not modified after this time,
350+
a ``304``, ``'Not Modified'`` response is sent. Otherwise, the content
349351
type is guessed by calling the :meth:`guess_type` method, which in turn
350-
uses the *extensions_map* variable.
352+
uses the *extensions_map* variable, and the file contents are returned.
351353

352354
A ``'Content-type:'`` header with the guessed content type is output,
353355
followed by a ``'Content-Length:'`` header with the file's size and a

0 commit comments

Comments
 (0)
0