From 85aa3d664c32af0532113f554002a5d3192faf29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 26 Jun 2018 23:04:06 +0200 Subject: MM-11034: Reply properly to incomming webhooks on errors (#9010) --- web/web.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'web/web.go') diff --git a/web/web.go b/web/web.go index 479f439fb..f41854cbd 100644 --- a/web/web.go +++ b/web/web.go @@ -73,7 +73,13 @@ func Handle404(a *app.App, w http.ResponseWriter, r *http.Request) { func IsApiCall(a *app.App, r *http.Request) bool { subpath, _ := utils.GetSubpathFromConfig(a.Config()) - return strings.Index(r.URL.Path, path.Join(subpath, "api")+"/") == 0 + return strings.HasPrefix(r.URL.Path, path.Join(subpath, "api")+"/") +} + +func IsWebhookCall(a *app.App, r *http.Request) bool { + subpath, _ := utils.GetSubpathFromConfig(a.Config()) + + return strings.HasPrefix(r.URL.Path, path.Join(subpath, "hooks")+"/") } func ReturnStatusOK(w http.ResponseWriter) { -- cgit v1.2.3-1-g7c22