Fix
This commit is contained in:
@@ -164,7 +164,7 @@ func pipe(a, b net.Conn) {
|
||||
|
||||
func (s *Server) Pre(foo http.HandlerFunc) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
ctx, can := context.WithTimeout(r.Context(), time.Second*time.Duration(config.GetTimeout()))
|
||||
ctx, can := context.WithTimeout(r.Context(), time.Duration(config.GetTimeout()))
|
||||
defer can()
|
||||
if err := s.limiter.Wait(ctx); err != nil {
|
||||
w.WriteHeader(http.StatusTooManyRequests)
|
||||
|
||||
Reference in New Issue
Block a user