From bdd4742171f359098953751e792d28fe2c8947ac Mon Sep 17 00:00:00 2001 From: Daisuke Fujita Date: Fri, 11 Sep 2015 19:05:30 +0900 Subject: [PATCH] Return 200 even if non-action webhook is come --- server/handler/hook.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/handler/hook.go b/server/handler/hook.go index e052fc543..c1a978784 100644 --- a/server/handler/hook.go +++ b/server/handler/hook.go @@ -40,6 +40,11 @@ func PostHook(c web.C, w http.ResponseWriter, r *http.Request) { return } + if hook == nil { + w.WriteHeader(http.StatusOK) + return + } + // in some cases we have neither a hook nor error. An example // would be GitHub sending a ping request to the URL, in which // case we'll just exit quiely with an 'OK'