Skip to content

Commit

Permalink
fox: use Mercure public URL for subscription URI creation if it is av…
Browse files Browse the repository at this point in the history
…ailable (#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.
  • Loading branch information
psihius authored Aug 21, 2024
1 parent 4b5ea85 commit 82073d3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ public function generateTopicIri(string $subscriptionId): string

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

0 comments on commit 82073d3

Please sign in to comment.