Merge pull request #5181 from harshit-ojha0324/fix/webhook-trailing-slash

fix(integrations): don't append a trailing slash when api_call path is '/'
This commit is contained in:
Boody
2026-07-05 03:44:19 +03:00
committed by GitHub
2 changed files with 124 additions and 1 deletions
+8 -1
View File
@@ -216,7 +216,14 @@ def _normalize_integration_base_url(base_url: Any) -> str:
def _join_integration_url(base_url: str, path: str) -> str:
return urljoin(base_url.rstrip("/") + "/", path.lstrip("/"))
base = base_url.rstrip("/")
rel = path.lstrip("/")
if not rel:
# A bare "/" must resolve to the base URL itself, not base + "/".
# POST-to-base integrations (e.g. Discord webhooks) 404 on the
# trailing-slash variant of their URL.
return base
return urljoin(base + "/", rel)
def load_integrations() -> List[Dict[str, Any]]: