Skip to content

Conversation

@dfangl
Copy link
Member

@dfangl dfangl commented Oct 6, 2025

Motivation

Even though [RFC 7230] states that header field names should be considered case insensitive, some clients to not conform to this specification.
Especially, the fluent bit cloudwatch client will assert the x-amzn-RequestId header - case sensitive.
To support this client, we need to return the correct casing for this response header.

This change not only changes the header (and has an AWS validated test to confirms it), but also adds the header to the query protocol, something I confirmed for cloudwatch in the test, and manually for EC2.

Changes

  • Add x-amzn-RequestId header for query protocol services
  • Correct casing for x-amzn-RequestId header for json and cbor (based) protocols

…rect request id casing, add requestid header to query protocol response
@dfangl dfangl requested a review from pinzon as a code owner October 6, 2025 15:04
@dfangl dfangl added semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases docs: skip Pull request does not require documentation changes labels Oct 6, 2025
@dfangl dfangl requested a review from steffyP as a code owner October 6, 2025 15:04
@dfangl dfangl added the notes: skip Pull request does not have to be mentioned in the release notes label Oct 6, 2025
@dfangl dfangl requested a review from alexrashed as a code owner October 6, 2025 15:04
@dfangl dfangl requested a review from bentsku October 6, 2025 15:04
@github-actions
Copy link

github-actions bot commented Oct 6, 2025

S3 Image Test Results (AMD64 / ARM64)

    2 files  ±0    2 suites  ±0   7m 47s ⏱️ -25s
  532 tests ±0  480 ✅ ±0   52 💤 ±0  0 ❌ ±0 
1 064 runs  ±0  960 ✅ ±0  104 💤 ±0  0 ❌ ±0 

Results for commit 9d36015. ± Comparison against base commit bf4ac0a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

Test Results - Preflight, Unit

22 291 tests  ±0   20 548 ✅ ±0   16m 39s ⏱️ +45s
     1 suites ±0    1 743 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 9d36015. ± Comparison against base commit bf4ac0a.

♻️ This comment has been updated with latest results.

@dfangl dfangl requested a review from thrau as a code owner October 6, 2025 15:26
Copy link
Contributor

@bentsku bentsku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, very nice catch, thanks for going the extra mile and validating the behavior against AWS. We might want to maybe check that against Pro just to be sure we don't have some tests validating the wrong behavior somewhere and then break.

(I'll maybe wait for the full run for fully LGTM-ing 😄)

This also looks like a safe change, as we're only increasing parity and most clients should already do the right thing 👍

response_parser = create_parser(service_protocol)
# Properly use HeadersDict from botocore to properly parse headers
response_dict = serialized_response.to_readonly_response_dict()
response_dict["headers"] = HeadersDict(response_dict.get("headers", {}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch! I was going to mention that we should probably fix it for _botocore_error_serializer_integration_test too, but it was already there 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have caught that, I had no idea as well 😅

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 22s ⏱️ -5s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 9d36015. ± Comparison against base commit bf4ac0a.

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

Test Results - Alternative Providers

180 tests    39 ✅  2m 33s ⏱️
  1 suites  141 💤
  1 files      0 ❌

Results for commit 9d36015.

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files      5 suites   2h 38m 40s ⏱️
5 169 tests 4 673 ✅ 496 💤 0 ❌
5 175 runs  4 673 ✅ 502 💤 0 ❌

Results for commit 9d36015.

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

LocalStack Community integration with Pro

    2 files      2 suites   2h 0m 50s ⏱️
4 795 tests 4 459 ✅ 336 💤 0 ❌
4 797 runs  4 459 ✅ 338 💤 0 ❌

Results for commit 9d36015.

Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for jumping on this! Really surprising how many SDKs do not really implement the HTTP spec (like case-insensitivity of header fields), but rely on specifics in the implementation of AWS services. 😅
Good catch and thanks for verifying! 💯

@dfangl
Copy link
Member Author

dfangl commented Oct 7, 2025

Running pro test against this branch: https://github.com/localstack/localstack-pro/actions/runs/18311931930 (sorry, started another run but copied the wrong branch before 😅 )

@dfangl
Copy link
Member Author

dfangl commented Oct 7, 2025

Only one (seemingly unrelated) failure in the pro runs, will merge this one!

@dfangl dfangl merged commit b592fbd into main Oct 7, 2025
47 checks passed
@dfangl dfangl deleted the ecs/firelens/config-file branch October 7, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants