Skip to content

Commit 88c8160

Browse files
committed
more pyright fixes and add changelogs
1 parent f08e98d commit 88c8160

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "bugfix",
3+
"description": "fix host header port mismatch in signing"
4+
}

packages/aws-sdk-signers/src/aws_sdk_signers/signers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from ._http import AWSRequest, Field, URI
1818
from ._io import AsyncBytesReader
1919
from .exceptions import AWSSDKWarning, MissingExpectedParameterException
20-
from .interfaces.http import URI as InterfaceURI
2120
from .interfaces.identity import AWSCredentialsIdentity as _AWSCredentialsIdentity
2221
from .interfaces.io import AsyncSeekable, ConditionallySeekable, Seekable
2322

@@ -346,7 +345,7 @@ def _is_signable_header(self, field_name: str):
346345
return False
347346
return True
348347

349-
def _normalize_host_field(self, *, uri: InterfaceURI) -> str:
348+
def _normalize_host_field(self, *, uri: URI) -> str:
350349
if uri.port is not None and DEFAULT_PORTS.get(uri.scheme) == uri.port:
351350
uri_dict = uri.to_dict()
352351
uri_dict.update({"port": None})
@@ -734,7 +733,7 @@ def _is_signable_header(self, field_name: str):
734733
return False
735734
return True
736735

737-
async def _normalize_host_field(self, *, uri: InterfaceURI) -> str:
736+
async def _normalize_host_field(self, *, uri: URI) -> str:
738737
if uri.port is not None and DEFAULT_PORTS.get(uri.scheme) == uri.port:
739738
uri_dict = uri.to_dict()
740739
uri_dict.update({"port": None})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "bugfix",
3+
"description": "add port to CRT HTTP client's host header"
4+
}

packages/smithy-http/src/smithy_http/aio/crt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ async def _marshal_request(
341341
:py:class:`smithy_http.aio.HTTPRequest`"""
342342
headers_list = []
343343
if "host" not in request.fields:
344-
host_header = request.destination.hostname
344+
host_header = request.destination.host
345345
if port := request.destination.port:
346346
host_header += f":{port}"
347347
request.fields.set_field(Field(name="host", values=[host_header]))

0 commit comments

Comments
 (0)