Skip to content

Commit

Permalink
Merge pull request #702 from LLluma/bug_sqs_url_china_region
Browse files Browse the repository at this point in the history
[BUG] Fix AWS SQS base domain parsing for China region
  • Loading branch information
tidwall authored Nov 20, 2023
2 parents 4c34a53 + 8ac31c6 commit ee61cd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/endpoint/sqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down

0 comments on commit ee61cd1

Please # to comment.