@@ -427,7 +427,9 @@ Command-line interface
427427switch of the interpreter. Similar to
428428the previous example, this serves files relative to the current directory::
429429
430- python -m http.server [--cgi] [-b ADDRESS] [-d DIRECTORY] [-p VERSION] [port]
430+ python -m http.server
431+
432+ The following options are accepted:
431433
432434.. program :: http.server
433435
@@ -472,6 +474,24 @@ the previous example, this serves files relative to the current directory::
472474
473475 .. versionadded :: 3.11
474476
477+ .. option :: --cgi
478+
479+ :class: `CGIHTTPRequestHandler ` can be enabled in the command line by passing
480+ the ``--cgi `` option::
481+
482+ python -m http.server --cgi
483+
484+ .. deprecated-removed :: 3.13 3.15
485+
486+ :mod: `http.server ` command line ``--cgi `` support is being removed
487+ because :class: `CGIHTTPRequestHandler ` is being removed.
488+
489+ .. warning ::
490+
491+ :class: `CGIHTTPRequestHandler ` and the ``--cgi `` command line option
492+ are not intended for use by untrusted clients and may be vulnerable
493+ to exploitation. Always use within a secure environment.
494+
475495
476496.. class :: CGIHTTPRequestHandler(request, client_address, server)
477497
@@ -521,21 +541,6 @@ the previous example, this serves files relative to the current directory::
521541 Retaining it could lead to further :ref: `security considerations
522542 <http.server-security>`.
523543
524- :class: `CGIHTTPRequestHandler ` can be enabled in the command line by passing
525- the ``--cgi `` option::
526-
527- python -m http.server --cgi
528-
529- .. deprecated-removed :: 3.13 3.15
530-
531- :mod: `http.server ` command line ``--cgi `` support is being removed
532- because :class: `CGIHTTPRequestHandler ` is being removed.
533-
534- .. warning ::
535-
536- :class: `CGIHTTPRequestHandler ` and the ``--cgi `` command line option
537- are not intended for use by untrusted clients and may be vulnerable
538- to exploitation. Always use within a secure environment.
539544
540545.. _http.server-security :
541546
0 commit comments