Merge pull request #1666 from calmh/cpu-remind

Reminder in debug output to explain high CPU usage
This commit is contained in:
Audrius Butkevicius 2015-04-20 08:09:56 +01:00
commit ef7420ecf6
1 changed files with 4 additions and 0 deletions

View File

@ -42,6 +42,10 @@ func basicAuthAndSessionMiddleware(cfg config.GUIConfiguration, next http.Handle
}
}
if debugHTTP {
l.Debugln("Sessionless HTTP request with authentication; this is expensive.")
}
error := func() {
time.Sleep(time.Duration(rand.Intn(100)+100) * time.Millisecond)
w.Header().Set("WWW-Authenticate", "Basic realm=\"Authorization Required\"")