File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1111from threading import Lock
1212from typing import TYPE_CHECKING , Any
1313
14+
1415if TYPE_CHECKING :
1516 # pyright doesn't like optional imports. This is reasonable because if we use these
1617 # in type hints then they'd result in runtime errors.
@@ -292,11 +293,14 @@ async def _marshal_request(
292293 """Create :py:class:`awscrt.http.HttpRequest` from
293294 :py:class:`smithy_http.aio.HTTPRequest`"""
294295 headers_list = []
295- if "Host " not in request .fields :
296+ if "host " not in request .fields :
296297 request .fields .set_field (
297- Field (name = "Host " , values = [request .destination .host ])
298+ Field (name = "host " , values = [request .destination .host ])
298299 )
299300
301+ if "accept" not in request .fields :
302+ request .fields .set_field (Field (name = "accept" , values = ["*/*" ]))
303+
300304 for fld in request .fields .entries .values ():
301305 # TODO: Use literal values for "header"/"trailer".
302306 if fld .kind .value != FieldPosition .HEADER .value :
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ async def test_client_marshal_request() -> None:
2828 )
2929 crt_request = await client ._marshal_request (request ) # type: ignore
3030 assert crt_request .headers .get ("host" ) == "example.com" # type: ignore
31+ assert crt_request .headers .get ("accept" ) == "*/*" # type: ignore
3132 assert crt_request .method == "GET" # type: ignore
3233 assert crt_request .path == "/path?key1=value1&key2=value2" # type: ignore
3334
You can’t perform that action at this time.
0 commit comments