Visiting invalid URLs and bad APIs causes redirect to error page

Этот коммит содержится в:
Christopher Speller
2016-04-01 11:48:19 -04:00
родитель 36f611fac4
Коммит 7e9c7ce60a
6 изменённых файлов: 123 добавлений и 42 удалений

Просмотреть файл

@@ -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()
}