From 808312b4093c9e99a4b28e848574240290de5d12 Mon Sep 17 00:00:00 2001 From: Ran K Date: Thu, 21 Oct 2021 15:05:26 +0100 Subject: [PATCH] Fix canonical URL when setting either port of host from the CLI (#196) * Fix canonical URL when setting either port of host from the CLI * Fix canonical URL (reformatted) Co-authored-by: Ran Katzir Co-authored-by: Taybin Rutkin --- faust/cli/worker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/faust/cli/worker.py b/faust/cli/worker.py index 0367e71c6..6b2a571cf 100644 --- a/faust/cli/worker.py +++ b/faust/cli/worker.py @@ -99,6 +99,10 @@ def _init_worker_options( self.app.conf.web_host = web_host if web_transport is not None: self.app.conf.web_transport = web_transport + if web_port is not None or web_host is not None: + self.app.conf.canonical_url = ( + f"http://{self.app.conf.web_host}:{self.app.conf.web_port}" + ) @property def _Worker(self) -> Type[Worker]: