Skip to content

Commit

Permalink
Support for httpmux Middleware vs MiddlewareFunc
Browse files Browse the repository at this point in the history
  • Loading branch information
fiorix committed Mar 16, 2016
1 parent 0fec4e9 commit 53a5920
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apiserver/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ func (f *apiHandler) config(mc *httpmux.Config) error {
mc.NotFound = f.publicDir()
}
if f.conf.UseXForwardedFor {
mc.Use(httplog.UseXForwardedFor)
mc.UseFunc(httplog.UseXForwardedFor)
}
if !f.conf.Silent {
mc.Use(httplog.ApacheCombinedFormat(f.conf.accessLogger()))
mc.UseFunc(httplog.ApacheCombinedFormat(f.conf.accessLogger()))
}
mc.Use(f.metrics)
mc.UseFunc(f.metrics)
if f.conf.RateLimitLimit > 0 {
rl, err := newRateLimiter(f.conf)
if err != nil {
return fmt.Errorf("failed to create rate limiter: %v", err)
}
mc.Use(rl.HandleFunc)
mc.Use(rl.Handle)
}
return nil
}
Expand Down

0 comments on commit 53a5920

Please sign in to comment.