Skip to content

Commit 82073d3

Browse files
authored
fox: use Mercure public URL for subscription URI creation if it is available (#6514)
This is required when publishing and reading host names are not the same, ex: docker environment ("mercure" vs "localhost:port" between server side and client side), having different publishing URL and public access url's, etc. Mercure itself and Mercure bundle have been supporting this for a while.
1 parent 4b5ea85 commit 82073d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GraphQl/Subscription/MercureSubscriptionIriGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ public function generateTopicIri(string $subscriptionId): string
4141

4242
public function generateMercureUrl(string $subscriptionId, ?string $hub = null): string
4343
{
44-
return \sprintf('%s?topic=%s', $this->registry->getHub($hub)->getUrl(), $this->generateTopicIri($subscriptionId));
44+
return \sprintf('%s?topic=%s', $this->registry->getHub($hub)->getPublicUrl(), $this->generateTopicIri($subscriptionId));
4545
}
4646
}

0 commit comments

Comments
 (0)