File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -343,11 +343,13 @@ of which this module provides three different variants:
343
343
:func: `os.listdir ` to scan the directory, and returns a ``404 `` error
344
344
response if the :func: `~os.listdir ` fails.
345
345
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
349
351
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 .
351
353
352
354
A ``'Content-type:' `` header with the guessed content type is output,
353
355
followed by a ``'Content-Length:' `` header with the file's size and a
You can’t perform that action at this time.
0 commit comments