Skip to content

Commit 6dcb402

Browse files
[3.14] Fix various typos in the http.server docs (GH-153089) (#153097)
(cherry picked from commit 99b4cdb) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 5095562 commit 6dcb402

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

Doc/library/http.server.rst

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ handler. Code to create and run the server looks like this::
7070
object fails with a :exc:`RuntimeError`.
7171

7272
The *certfile* argument is the path to the SSL certificate chain file,
73-
and the *keyfile* is the path to file containing the private key.
73+
and the *keyfile* is the path to the file containing the private key.
7474

7575
A *password* can be specified for files protected and wrapped with PKCS#8,
7676
but beware that this could possibly expose hardcoded passwords in clear.
@@ -150,7 +150,7 @@ instantiation, of which this module provides three different variants:
150150

151151
.. attribute:: path
152152

153-
Contains the request path. If query component of the URL is present,
153+
Contains the request path. If the query component of the URL is present,
154154
then ``path`` includes the query. Using the terminology of :rfc:`3986`,
155155
``path`` here includes ``hier-part`` and the ``query``.
156156

@@ -200,7 +200,7 @@ instantiation, of which this module provides three different variants:
200200
Specifies a format string that should be used by :meth:`send_error` method
201201
for building an error response to the client. The string is filled by
202202
default with variables from :attr:`responses` based on the status code
203-
that passed to :meth:`send_error`.
203+
passed to :meth:`send_error`.
204204

205205
.. attribute:: error_content_type
206206

@@ -248,8 +248,8 @@ instantiation, of which this module provides three different variants:
248248
.. method:: handle_expect_100()
249249

250250
When an HTTP/1.1 conformant server receives an ``Expect: 100-continue``
251-
request header it responds back with a ``100 Continue`` followed by ``200
252-
OK`` headers.
251+
request header it responds with a ``100 Continue`` followed by ``200 OK``
252+
headers.
253253
This method can be overridden to raise an error if the server does not
254254
want the client to continue. For example, the server can choose to send ``417
255255
Expectation Failed`` as a response header and ``return False``.
@@ -305,8 +305,8 @@ instantiation, of which this module provides three different variants:
305305
.. method:: send_response_only(code, message=None)
306306

307307
Sends the response header only, used for the purposes when ``100
308-
Continue`` response is sent by the server to the client. The headers not
309-
buffered and sent directly the output stream.If the *message* is not
308+
Continue`` response is sent by the server to the client. The headers are
309+
not buffered and sent directly the output stream. If the *message* is not
310310
specified, the HTTP message corresponding the response *code* is sent.
311311

312312
This method does not reject *message* containing CRLF sequences.
@@ -348,7 +348,7 @@ instantiation, of which this module provides three different variants:
348348
to create custom error logging mechanisms. The *format* argument is a
349349
standard printf-style format string, where the additional arguments to
350350
:meth:`log_message` are applied as inputs to the formatting. The client
351-
ip address and current date and time are prefixed to every message logged.
351+
IP address and current date and time are prefixed to every message logged.
352352

353353
.. method:: version_string()
354354

@@ -483,9 +483,8 @@ instantiation, of which this module provides three different variants:
483483
Add :func:`mimetypes.guess_file_type` as a fallback.
484484

485485

486-
The :class:`SimpleHTTPRequestHandler` class can be used in the following
487-
manner in order to create a very basic webserver serving files relative to
488-
the current directory::
486+
The :class:`SimpleHTTPRequestHandler` class can be used to create a very basic
487+
webserver serving files relative to the current directory as follows::
489488

490489
import http.server
491490
import socketserver
@@ -681,13 +680,13 @@ Security considerations
681680
.. index:: pair: http.server; security
682681

683682
:class:`SimpleHTTPRequestHandler` will follow symbolic links when handling
684-
requests, this makes it possible for files outside of the specified directory
683+
requests which makes it possible for files outside of the specified directory
685684
to be served.
686685

687686
Methods :meth:`BaseHTTPRequestHandler.send_header` and
688687
:meth:`BaseHTTPRequestHandler.send_response_only` assume sanitized input
689688
and do not perform input validation such as checking for the presence of CRLF
690-
sequences. Untrusted input may result in HTTP Header injection attacks.
689+
sequences. Untrusted input may result in HTTP header injection attacks.
691690

692691
Earlier versions of Python did not scrub control characters from the
693692
log messages emitted to stderr from ``python -m http.server`` or the

0 commit comments

Comments
 (0)