Commit 903c42c0 authored by Landon James's avatar Landon James
Browse files

Fix casing of DEFAULT_ALGORITHM

parent c6b0442b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ private fun HttpChecksumTrait.requestAlgorithmMember(
// This is the single place where the default algorithm is set. It must be all uppercased.
// There is some special logic in HttpChecksumTest and in the http_request_checksum inlineable
// for testing the default case, if you change this value you will have to update that logic as well.
const val defaultAlgorithm = "CRC32"
const val DEFAULT_ALGORITHM = "CRC32"

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