From 8ac31c6234970ecf83a2ff98dd8384c15afb5490 Mon Sep 17 00:00:00 2001 From: Yaroslav Shumlianskyi Date: Tue, 22 Aug 2023 21:56:20 +0300 Subject: [PATCH] [BUG] Fix AWS SQS base domain parsing for China region For AWS China region base domain is slightly different than for the rest world. It is `amazon.com.cn`. Currently AWS domain is hard coded in the `sqs.go`. Would be nice if that will be configured parameter. But this is a minimal posible change which is not breaking exist code and make possible to use it for AWS China region. --- internal/endpoint/sqs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/endpoint/sqs.go b/internal/endpoint/sqs.go index fae871e5..e83a8711 100644 --- a/internal/endpoint/sqs.go +++ b/internal/endpoint/sqs.go @@ -132,13 +132,13 @@ func newSQSConn(ep Endpoint) *SQSConn { func probeSQS(s string) bool { // https://sqs.eu-central-1.amazonaws.com/123456789/myqueue return strings.HasPrefix(s, "https://sqs.") && - strings.Contains(s, ".amazonaws.com/") + strings.Contains(s, ".amazonaws.com") } func sqsRegionFromPlainURL(s string) string { parts := strings.Split(s, "https://sqs.") if len(parts) > 1 { - parts = strings.Split(parts[1], ".amazonaws.com/") + parts = strings.Split(parts[1], ".amazonaws.com") if len(parts) > 1 { return parts[0] }