From d9ad314d1670eab0729847d380d984a23ad9117c Mon Sep 17 00:00:00 2001 From: hellerve Date: Fri, 9 Dec 2016 12:04:08 +0100 Subject: [PATCH] send too many requests on rate limit reached --- endpoints/endpoint.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/endpoints/endpoint.go b/endpoints/endpoint.go index e27ee35..73c078f 100644 --- a/endpoints/endpoint.go +++ b/endpoints/endpoint.go @@ -15,6 +15,10 @@ func Endpoint(wrapped func(httprouter.Params) (bird.Parsed, bool)) httprouter.Ha res := make(map[string]interface{}) ret, from_cache := wrapped(ps) + if ret == nil { + w.WriteHeader(http.StatusTooManyRequests) + return + } res["api"] = GetApiInfo(from_cache) for k, v := range ret {