Skip to content

Commit d26bd4c

Browse files
Merge pull request #56 from shopware/fix-55/check-shop-url-is-reachable-in-maintenance-mode
fix: check if api is reachable during registration
2 parents 45f54f8 + 7059e38 commit d26bd4c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/EventListener/BeforeRegistrationStartsListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __invoke(BeforeRegistrationStartsEvent $event): void
3333
$shop = $event->getShop();
3434

3535
try {
36-
$this->httpClient->request('HEAD', $shop->getShopUrl(), [
36+
$this->httpClient->request('HEAD', sprintf("%s/api/_info/config", $shop->getShopUrl()), [
3737
'timeout' => 10,
3838
'max_redirects' => 0,
3939
]);

tests/EventListener/BeforeRegistrationStartsListenerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testListenerMustBeExecutedWithoutErrorsIfTheCheckIsSetToTrueInCo
5959
$this->httpClient
6060
->expects(self::once())
6161
->method('request')
62-
->with('HEAD', 'https://shop-url.com', [
62+
->with('HEAD', 'https://shop-url.com/api/_info/config', [
6363
'timeout' => 10,
6464
'max_redirects' => 0,
6565
]);
@@ -91,7 +91,7 @@ public function testListenerMustThrowExceptionBecauseTheShopURLIsNotReachable():
9191
$this->httpClient
9292
->expects(self::once())
9393
->method('request')
94-
->with('HEAD', 'https://shop-url.com', [
94+
->with('HEAD', 'https://shop-url.com/api/_info/config', [
9595
'timeout' => 10,
9696
'max_redirects' => 0,
9797
])

0 commit comments

Comments
 (0)