diff --git a/.changeset/good-cheetahs-press.md b/.changeset/good-cheetahs-press.md new file mode 100644 index 00000000000..98d8f648e88 --- /dev/null +++ b/.changeset/good-cheetahs-press.md @@ -0,0 +1,5 @@ +--- +"@smithy/util-endpoints": patch +--- + +Do not take protocol and port from custom Endpoint diff --git a/packages/util-endpoints/src/__mocks__/test-cases/parse-url.json b/packages/util-endpoints/src/__mocks__/test-cases/parse-url.json index 58119a37373..016aa8eb324 100644 --- a/packages/util-endpoints/src/__mocks__/test-cases/parse-url.json +++ b/packages/util-endpoints/src/__mocks__/test-cases/parse-url.json @@ -72,7 +72,7 @@ }, "expect": { "endpoint": { - "url": "http://http-99_ab.com-nopath.example.com" + "url": "https://http-99_ab.com-nopath.example.com" } } }, @@ -83,7 +83,7 @@ }, "expect": { "endpoint": { - "url": "http://http-99_ab-.com-nopath.example.com" + "url": "https://http-99_ab-.com-nopath.example.com" } } }, diff --git a/packages/util-endpoints/src/resolveEndpoint.ts b/packages/util-endpoints/src/resolveEndpoint.ts index a3837a7e2e3..ad426404233 100644 --- a/packages/util-endpoints/src/resolveEndpoint.ts +++ b/packages/util-endpoints/src/resolveEndpoint.ts @@ -36,18 +36,6 @@ export const resolveEndpoint = (ruleSetObject: RuleSetObject, options: EndpointR const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} }); - if (options.endpointParams?.Endpoint) { - // take protocol and port from custom Endpoint if present. - try { - const givenEndpoint = new URL(options.endpointParams.Endpoint as string); - const { protocol, port } = givenEndpoint; - endpoint.url.protocol = protocol; - endpoint.url.port = port; - } catch (e) { - // ignored - } - } - options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); return endpoint;