From 7e9c7ce60a90f3628888f178c27642561643abaa Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 1 Apr 2016 11:48:19 -0400 Subject: Visiting invalid URLs and bad APIs causes redirect to error page --- api/api.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'api/api.go') diff --git a/api/api.go b/api/api.go index 20f77e558..476047877 100644 --- a/api/api.go +++ b/api/api.go @@ -27,6 +27,8 @@ func InitApi() { InitWebhook(r) InitPreference(r) InitLicense(r) + // 404 on any api route before web.go has a chance to serve it + Srv.Router.Handle("/api/{anything:.*}", http.HandlerFunc(Handle404)) utils.InitHTML() } -- cgit v1.2.3-1-g7c22