You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/05/24 21:37:46 UTC

[GitHub] [airflow] yoshichulo commented on a change in pull request #16003: Fixed Discord Webhook endpoint

yoshichulo commented on a change in pull request #16003:
URL: https://github.com/apache/airflow/pull/16003#discussion_r638289493



##########
File path: airflow/providers/discord/hooks/discord_webhook.py
##########
@@ -101,7 +101,7 @@ def _get_webhook_endpoint(self, http_conn_id: Optional[str], webhook_endpoint: O
                 'Expected Discord webhook endpoint in the form of "webhooks/{webhook.id}/{webhook.token}".'
             )
 
-        return endpoint
+        return f'https://discord.com/api/{endpoint}'

Review comment:
       I mean, yes, you can, but:
   1. Has to follow the regex `^webhooks/[0-9]+/[a-zA-Z0-9_-]+$`
   2. It is used on the `HttpHook` as it is, it means, as an endpoint directly. With that, I mean that the URI generated will be `https://webhooks/{webhook.id}/{webhook.token}`, being it wrong.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org