mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-27 08:18:24 +03:00
Fixed mercure hub URL returned by MercureInfoAction
This commit is contained in:
parent
72d8edf4ff
commit
b858d79b9e
2 changed files with 4 additions and 2 deletions
|
@ -13,6 +13,8 @@ use Shlinkio\Shlink\Common\Mercure\JwtProviderInterface;
|
|||
use Shlinkio\Shlink\Rest\Exception\MercureException;
|
||||
use Throwable;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
class MercureInfoAction extends AbstractRestAction
|
||||
{
|
||||
protected const ROUTE_PATH = '/mercure-info';
|
||||
|
@ -48,7 +50,7 @@ class MercureInfoAction extends AbstractRestAction
|
|||
}
|
||||
|
||||
return new JsonResponse([
|
||||
'mercureHubUrl' => $hubUrl,
|
||||
'mercureHubUrl' => sprintf('%s/.well-known/mercure', $hubUrl),
|
||||
'token' => $jwt,
|
||||
'jwtExpiration' => $expiresAt->toAtomString(),
|
||||
]);
|
||||
|
|
|
@ -89,7 +89,7 @@ class MercureInfoActionTest extends TestCase
|
|||
$payload = $resp->getPayload();
|
||||
|
||||
$this->assertArrayHasKey('mercureHubUrl', $payload);
|
||||
$this->assertEquals('http://foobar.com', $payload['mercureHubUrl']);
|
||||
$this->assertEquals('http://foobar.com/.well-known/mercure', $payload['mercureHubUrl']);
|
||||
$this->assertArrayHasKey('token', $payload);
|
||||
$this->assertArrayHasKey('jwtExpiration', $payload);
|
||||
$this->assertEquals(
|
||||
|
|
Loading…
Reference in a new issue