Skip to content

Commit ec1f695

Browse files
authored
Fix endpoint override for .NET SDK generator (#1088)
PR #1082 migrated the C# telemetry generator to AWS SDK V4. Due to changes in contracts with this version, a Custom PartialConfig file was added to meet the interface requirements for configuring endpoints with the ClientConfig. This caused issues during runtime since our client does not rely on endpoitns. As a workaround as per .NET SDK team's guidance, since our client always sets the ServiceUrl on out client, a fix along those lines has been made to short-circuit the underlying logic and return endpoint based on the service url.
1 parent 353ebfb commit ec1f695

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

telemetry/csharp/AwsToolkit.Telemetry.SDK/Custom/AmazonToolkitTelemetryConfig.Partial.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,8 @@ public partial class AmazonToolkitTelemetryConfig
3131
/// <returns>The resolved endpoint for the given request.</returns>
3232
public override Amazon.Runtime.Endpoints.Endpoint DetermineServiceOperationEndpoint(ServiceOperationEndpointParameters parameters)
3333
{
34-
var request = new DefaultRequest(parameters.Request, ServiceId);
35-
request.AlternateEndpoint = parameters.AlternateEndpoint;
36-
37-
var requestContext = new RequestContext(false);
38-
requestContext.ClientConfig = this;
39-
requestContext.OriginalRequest = parameters.Request;
40-
requestContext.Request = request;
41-
var executionContext = new Amazon.Runtime.Internal.ExecutionContext(requestContext, null);
42-
return new BaseEndpointResolver().GetEndpoint(executionContext);
34+
var endpoint = new Endpoint(this.ServiceURL);
35+
return endpoint;
4336
}
4437
}
4538
}

0 commit comments

Comments
 (0)