fix(sns): deliver to HTTP endpoints over HTTP/1.1 (#7414)

The SNS HttpClient used the JDK default version, HTTP_2, so every http:// delivery carried an h2c upgrade offer (Connection: Upgrade, Upgrade: h2c), which AWS SNS never sends. Servers that accept the upgrade read an empty request body. Pin the client to HTTP/1.1, as HttpProxyInvoker already does.

Closes #7426
This commit is contained in:
Xavier H. authored and GitHub committed 2026-11-03 12:52:11 -04:00
1 parent dddc0b85cb
commit 8c252ef0de
2 files changed
+10 -1

No files matched your search

@@ -159,6 +159,9 @@ class SnsHttpDeliveryIntegrationTest {
assertEquals(1, receivedRequests.size());
ReceivedRequest confirmReq = receivedRequests.get(0);
assertEquals("SubscriptionConfirmation", confirmReq.headers().get("X-amz-sns-message-type").get(0));
// AWS SNS posts plain HTTP/1.1, with no h2c upgrade offer.
assertNull(firstHeader(confirmReq.headers(), "Upgrade"));
assertNull(firstHeader(confirmReq.headers(), "HTTP2-Settings"));
// Confirm the subscription
confirmSubscription(confirmReq);
@@ -192,6 +195,8 @@ class SnsHttpDeliveryIntegrationTest {
assertEquals(topicArn, req.headers().get("X-amz-sns-topic-arn").get(0));
assertNotNull(req.headers().get("X-amz-sns-message-id"));
assertNotNull(req.headers().get("X-amz-sns-subscription-arn"));
assertNull(firstHeader(req.headers(), "Upgrade"));
assertNull(firstHeader(req.headers(), "HTTP2-Settings"));
// Verify body is a proper SNS notification envelope
JsonNode envelope = objectMapper.readTree(req.body());