Skip to content

Commit 903c42c

Browse files
committed
Fix casing of DEFAULT_ALGORITHM
1 parent c6b0442 commit 903c42c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/HttpRequestChecksumDecorator.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private fun HttpChecksumTrait.requestAlgorithmMember(
105105
// This is the single place where the default algorithm is set. It must be all uppercased.
106106
// There is some special logic in HttpChecksumTest and in the http_request_checksum inlineable
107107
// for testing the default case, if you change this value you will have to update that logic as well.
108-
const val defaultAlgorithm = "CRC32"
108+
const val DEFAULT_ALGORITHM = "CRC32"
109109

110110
/**
111111
* Extract the name of the operation's input member that indicates which checksum algorithm to use
@@ -121,7 +121,7 @@ private fun HttpChecksumTrait.checksumAlgorithmToStr(
121121
return {
122122
if (requestAlgorithmMember == null && isRequestChecksumRequired) {
123123
// Checksums are required but a user can't set one, so we set the default for them
124-
rust("""let checksum_algorithm = Some("${defaultAlgorithm.lowercase()}");""")
124+
rust("""let checksum_algorithm = Some("${DEFAULT_ALGORITHM.lowercase()}");""")
125125
} else {
126126
// Use checksum algo set by user
127127
rust("""let checksum_algorithm = checksum_algorithm.map(|algorithm| algorithm.as_str());""")
@@ -225,7 +225,7 @@ class HttpRequestChecksumCustomization(
225225
(_, _, _, _, true) => {}
226226
(#{RequestChecksumCalculation}::WhenSupported, _, false, false, _)
227227
| (#{RequestChecksumCalculation}::WhenRequired, true, false, false, _) => {
228-
request.headers_mut().insert(${requestAlgoHeader.dq()}, "$defaultAlgorithm");
228+
request.headers_mut().insert(${requestAlgoHeader.dq()}, "$DEFAULT_ALGORITHM");
229229
}
230230
_ => {},
231231
}

0 commit comments

Comments
 (0)