|
4 | 4 | */ |
5 | 5 | package software.amazon.smithy.kotlin.codegen.rendering.protocol |
6 | 6 |
|
7 | | -import software.amazon.smithy.aws.traits.HttpChecksumTrait |
8 | 7 | import software.amazon.smithy.codegen.core.Symbol |
9 | 8 | import software.amazon.smithy.kotlin.codegen.core.* |
10 | 9 | import software.amazon.smithy.kotlin.codegen.integration.SectionId |
@@ -338,21 +337,14 @@ open class HttpProtocolClientGenerator( |
338 | 337 |
|
339 | 338 | /** |
340 | 339 | * Render optionally installing Md5ChecksumMiddleware. |
341 | | - * The Md5 middleware will only be installed if the operation requires a checksum and the user has not opted-in to flexible checksums. |
| 340 | + * The Md5 middleware will only be installed if the operation requires a checksum. |
342 | 341 | */ |
343 | 342 | private fun OperationShape.renderIsMd5ChecksumRequired(writer: KotlinWriter) { |
344 | | - val httpChecksumTrait = getTrait<HttpChecksumTrait>() |
345 | | - |
346 | | - // the checksum requirement can be modeled in either HttpChecksumTrait's `requestChecksumRequired` or the HttpChecksumRequired trait |
347 | | - if (!hasTrait<HttpChecksumRequiredTrait>() && httpChecksumTrait == null) { |
348 | | - return |
349 | | - } |
350 | | - |
351 | | - if (hasTrait<HttpChecksumRequiredTrait>() || httpChecksumTrait?.isRequestChecksumRequired == true) { |
| 343 | + if (hasTrait<HttpChecksumRequiredTrait>()) { |
352 | 344 | val interceptorSymbol = RuntimeTypes.HttpClient.Interceptors.Md5ChecksumInterceptor |
353 | 345 | val inputSymbol = ctx.symbolProvider.toSymbol(ctx.model.expectShape(inputShape)) |
354 | 346 | writer.withBlock("op.interceptors.add(#T<#T> {", "})", interceptorSymbol, inputSymbol) { |
355 | | - writer.write("op.context.getOrNull(#T.ChecksumAlgorithm) == null", RuntimeTypes.HttpClient.Operation.HttpOperationContext) |
| 347 | + writer.write("true", RuntimeTypes.HttpClient.Operation.HttpOperationContext) |
356 | 348 | } |
357 | 349 | } |
358 | 350 | } |
|
0 commit comments