From 50c21f053d7502aacc1d37f00330414b74e52b7d Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Fri, 29 May 2026 15:54:49 -0400 Subject: [PATCH] Document HTTPClient header validation contract --- .../src/smithy_http/aio/interfaces/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/smithy-http/src/smithy_http/aio/interfaces/__init__.py b/packages/smithy-http/src/smithy_http/aio/interfaces/__init__.py index 9c169c7c7..852ccebb2 100644 --- a/packages/smithy-http/src/smithy_http/aio/interfaces/__init__.py +++ b/packages/smithy-http/src/smithy_http/aio/interfaces/__init__.py @@ -64,7 +64,14 @@ def consume_body(self) -> bytes: class HTTPClient(ClientTransport[HTTPRequest, HTTPResponse], Protocol): - """An asynchronous HTTP client interface.""" + """An asynchronous HTTP client interface. + + Header field names and values are not validated before reaching this + layer. Implementations of ``HTTPClient`` are responsible for this + validation: if a request's fields contain characters prohibited by + the HTTP specifications (such as CR or LF), the request MUST be + rejected. + """ def __init__(self, *, client_config: HTTPClientConfiguration | None) -> None: """