8000 bug #36370 Update Connection.php (infinitely-young) · symfony/symfony@168574d · GitHub
[go: up one dir, main page]

Skip to content

Commit 168574d

Browse files
committed
bug #36370 Update Connection.php (infinitely-young)
This PR was squashed before being merged into the 5.1-dev branch. Discussion ---------- Update Connection.php Get `region` from `host` to prevent error "Credential should be scoped to a valid region, not '...'" and make it easier to setup DSN | Q | A | ------------- | --- | Branch? | master for features / 3.4, 4.4 or 5.0 for bug fixes <!-- see below --> | Bug fix? | yes/no | New feature? | yes/no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master. --> Commits ------- af68048 Update Connection.php
2 parents c6a176d + af68048 commit 168574d

File tree

1 file changed

+3
-0
lines changed
  • src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport

1 file changed

+3
-0
lines changed

src/Symfony/Component/Messenger/Bri 9325 dge/AmazonSqs/Transport/Connection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ public static function fromDsn(string $dsn, array $options = [], HttpClientInter
105105
$configuration['endpoint'] = sprintf('https://sqs.%s.amazonaws.com', $configuration['region']);
106106
} else {
107107
$configuration['endpoint'] = sprintf('%s://%s%s', ($query['sslmode'] ?? null) === 'disable' ? 'http' : 'https', $parsedUrl['host'], ($parsedUrl['port'] ?? null) ? ':'.$parsedUrl['port'] : '');
108+
if (preg_match(';sqs.(.+).amazonaws.com;', $parsedUrl['host'], $matches)) {
109+
$configuration['region'] = $matches[1];
110+
}
108111
unset($query['sslmode']);
109112
}
110113

0 commit comments

Comments
 (0)
0