Skip to content

Commit 9a777e0

Browse files
Forward selected host
1 parent 7e34bde commit 9a777e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

codegen/core/src/main/java/software/amazon/smithy/python/codegen/integrations/RestJsonProtocolGenerator.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ public class RestJsonProtocolGenerator implements ProtocolGenerator {
4343
// This requires support of the httpChecksumRequired trait
4444
"RestJsonHttpChecksumRequired",
4545

46-
// These require support of the endpoint trait
47-
"RestJsonEndpointTraitWithHostLabel",
48-
"RestJsonEndpointTrait",
49-
5046
// TODO: support the request compression trait
5147
// https://smithy.io/2.0/spec/behavior-traits.html#smithy-api-requestcompression-trait
5248
"SDKAppliedContentEncoding_restJson1",

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ def set_service_endpoint(
5050
if uri.query is not None and previous.query is not None:
5151
query = f"{uri.query}&{previous.query}"
5252

53+
host = uri.host
54+
if previous.host:
55+
host = previous.host + uri.host
56+
5357
request.destination = _URI(
5458
scheme=uri.scheme,
5559
username=uri.username or previous.username,
5660
password=uri.password or previous.password,
57-
host=uri.host,
61+
host=host,
5862
port=uri.port or previous.port,
5963
path=path,
6064
query=query,

0 commit comments

Comments
 (0)