Skip to content

Commit cf555fe

Browse files
authored
Add docstring for HTTPClient header validation contract (#706)
* Document HTTPClient header validation contract * Cite RFC 9110 Section 5.5 in docstring
1 parent 31c2818 commit cf555fe

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • packages/smithy-http/src/smithy_http/aio/interfaces

packages/smithy-http/src/smithy_http/aio/interfaces/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,14 @@ def consume_body(self) -> bytes:
6464

6565

6666
class HTTPClient(ClientTransport[HTTPRequest, HTTPResponse], Protocol):
67-
"""An asynchronous HTTP client interface."""
67+
"""An asynchronous HTTP client interface.
68+
69+
Header field names and values are not validated before reaching this
70+
layer. Implementations of ``HTTPClient`` are responsible for
71+
validating and handling those invalid and dangerous characters (such
72+
as CR, LF, or NUL) as defined in `RFC 9110, Section 5.5
73+
<https://www.rfc-editor.org/rfc/rfc9110#section-5.5>`_.
74+
"""
6875

6976
def __init__(self, *, client_config: HTTPClientConfiguration | None) -> None:
7077
"""

0 commit comments

Comments
 (0)