This document connects the header-optimization specification to the implementation in this repository. It is informative: deviations recorded here do not weaken the generic contract.
AlternatorConfig exposes
optimizeHeaders, headersWhitelist, and computed required-header sets. Client builders infer
authentication and user-agent enablement and combine those settings with compression requirements.
HeadersFilteringSdkHttpClient
and
HeadersFilteringSdkAsyncHttpClient
rebuild each outgoing request with allowed headers. Their normalized whitelist snapshots use
locale-independent lowercase matching.
User-agent transformation is performed by
UserAgentSdkHttpClient
and
UserAgentSdkAsyncHttpClient.
Attempt-routing wrappers are outermost, so they consume invocation metadata before header filtering removes it. Header filters wrap user-agent transforms and the main transport. Closing the outer transport delegates through each wrapper to the underlying transport. Polling clients are configured separately and are not wrapped by main-transport filtering.
| Requirement | Code | Test evidence | Status |
|---|---|---|---|
HEAD-REQ-001 |
HeadersFilteringSdkHttpClient |
FeatureSpecDefaultsTest#headerOptimizationDefaultMatchesSpecification |
conformant |
HEAD-REQ-002 |
AlternatorConfig |
AlternatorConfigHeadersTest#testFullHeadersWhitelistContents |
gap |
HEAD-REQ-003 |
AlternatorConfig |
AlternatorConfigHeadersTest#testCustomWhitelistMissingRequiredHeadersThrows |
gap |
HEAD-REQ-004 |
AlternatorDynamoDbClient |
AlternatorDynamoDbClientCustomizerTest#testWithAlternatorConfigEnablesDefaultUserAgentTransformer |
gap |
HEAD-REQ-005 |
HeadersFilteringSdkAsyncHttpClient |
HeadersFilteringSdkAsyncHttpClientTest#testPreservesMetricCollector |
gap |
HEAD-REQ-006 |
HeadersFilteringSdkAsyncHttpClient |
HeadersFilteringSdkAsyncHttpClientTest#testFiltersNonWhitelistedHeaders |
gap |
FeatureSpecDefaultsTestexecutes the machine-readable opt-in default.AlternatorConfigHeadersTestcovers required sets, custom validation, immutability, and feature combinations.HeadersFilteringSdkHttpClientTestcovers blocking filtering, case, multi-value headers, body providers, and lifecycle.HeadersFilteringSdkAsyncHttpClientTestcovers non-blocking publishers, handlers, duplex, metrics, completion, and lifecycle.UserAgentSdkHttpClientTestandUserAgentSdkAsyncHttpClientTestcover user-agent wrapper behavior.
HEAD-REQ-002: The computed authentication whitelist contains onlyAuthorizationandX-Amz-Date. It dropsX-Amz-Security-Tokenfor temporary credentials and cannot automatically preserve extra headers introduced by a custom signer. Tests use only basic credentials.HEAD-REQ-003: A non-empty custom whitelist containing null reaches validation and throwsNullPointerException; empty entries are accepted when all required headers are present. Validation also uses the process default locale, so ASCII-equivalent casing can fail under locales such as Turkish.HEAD-REQ-004: Per-attempt routing can change the transport URI after signing while retaining an earlierHostandAuthorization; see the query-plan implementation details.HEAD-REQ-005,HEAD-REQ-006: Blocking filtering and user-agent wrappers drop the request metric collector. Non-blocking filtering and user-agent wrappers drop HTTP execution attributes. Direct tests do not exercise these fields.