mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-13 05:42:24 +03:00
Remove unneeded context in log calls
This commit is contained in:
parent
f0160f5d2a
commit
482f46f3fd
@ -38,13 +38,13 @@ func (app *Router) routes(path string) http.Handler {
|
|||||||
r := chi.NewRouter()
|
r := chi.NewRouter()
|
||||||
|
|
||||||
if conf.Server.AuthRequestLimit > 0 {
|
if conf.Server.AuthRequestLimit > 0 {
|
||||||
log.Info(context.TODO(), "Login rate limit set", "requestLimit", conf.Server.AuthRequestLimit,
|
log.Info("Login rate limit set", "requestLimit", conf.Server.AuthRequestLimit,
|
||||||
"windowLength", conf.Server.AuthWindowLength)
|
"windowLength", conf.Server.AuthWindowLength)
|
||||||
rateLimiter := httprate.LimitByIP(conf.Server.AuthRequestLimit, conf.Server.AuthWindowLength)
|
|
||||||
|
|
||||||
|
rateLimiter := httprate.LimitByIP(conf.Server.AuthRequestLimit, conf.Server.AuthWindowLength)
|
||||||
r.With(rateLimiter).Post("/login", Login(app.ds))
|
r.With(rateLimiter).Post("/login", Login(app.ds))
|
||||||
} else {
|
} else {
|
||||||
log.Warn(context.TODO(), "Login rate limit is disabled! Consider enabling it to be protected against brute-force attacks")
|
log.Warn("Login rate limit is disabled! Consider enabling it to be protected against brute-force attacks")
|
||||||
|
|
||||||
r.Post("/login", Login(app.ds))
|
r.Post("/login", Login(app.ds))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user