From 6196e39b780381bbd0678c8a9e51f404096ca713 Mon Sep 17 00:00:00 2001 From: dvilela Date: Fri, 7 Jun 2024 13:14:46 +0200 Subject: [PATCH] fix: http handler endpoint --- packages/dvilela/agents/tsunami/aea-config.yaml | 1 + packages/dvilela/skills/tsunami_abci/handlers.py | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/dvilela/agents/tsunami/aea-config.yaml b/packages/dvilela/agents/tsunami/aea-config.yaml index 78d189e..dc7f815 100644 --- a/packages/dvilela/agents/tsunami/aea-config.yaml +++ b/packages/dvilela/agents/tsunami/aea-config.yaml @@ -227,6 +227,7 @@ models: suno_enabled: ${bool:true} telegram_token: ${str:null} telegram_chat_id: ${int:null} + service_endpoint: ${str:https://tsunami.dummy.com/} --- public_id: valory/http_server:0.22.0:bafybeicblltx7ha3ulthg7bzfccuqqyjmihhrvfeztlgrlcoxhr7kf6nbq type: connection diff --git a/packages/dvilela/skills/tsunami_abci/handlers.py b/packages/dvilela/skills/tsunami_abci/handlers.py index 11ccc5d..d55c526 100644 --- a/packages/dvilela/skills/tsunami_abci/handlers.py +++ b/packages/dvilela/skills/tsunami_abci/handlers.py @@ -135,12 +135,11 @@ def setup(self) -> None: config_uri_base_hostname = urlparse( self.context.params.service_endpoint ).hostname - propel_uri_base_hostname = ( - r"https?:\/\/[a-zA-Z0-9]{16}.agent\.propel\.(staging\.)?autonolas\.tech" - ) # Route regexes - hostname_regex = rf".*({config_uri_base_hostname}|{propel_uri_base_hostname}|localhost|127.0.0.1|0.0.0.0)(:\d+)?" + hostname_regex = ( + rf".*({config_uri_base_hostname}|localhost|127.0.0.1|0.0.0.0)(:\d+)?" + ) self.handler_url_regex = ( # pylint: disable=attribute-defined-outside-init rf"{hostname_regex}\/.*" ) @@ -174,7 +173,7 @@ def _get_handler(self, url: str, method: str) -> Tuple[Optional[Callable], Dict] # Check base url if not re.match(self.handler_url_regex, url): self.context.logger.info( - f"The url {url} does not match the DynamicNFT HttpHandler's pattern" + f"The url {url} does not match the HttpHandler's pattern: {self.handler_url_regex}" ) return None, {} @@ -191,7 +190,7 @@ def _get_handler(self, url: str, method: str) -> Tuple[Optional[Callable], Dict] # No route found self.context.logger.info( - f"The message [{method}] {url} is intended for the DynamicNFT HttpHandler but did not match any valid pattern" + f"The message [{method}] {url} is intended for the HttpHandler but did not match any valid pattern" ) return self._handle_bad_request, {}