diff options
-rw-r--r-- | main.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/main.go b/main.go index 92e2d9c..40a66db 100644 --- a/main.go +++ b/main.go @@ -23,16 +23,16 @@ func main() { // Handling incoming HTTP connections func httpHandler(w http.ResponseWriter, r *http.Request) { - // Raise stats - metrics_num_passwords++ - - // Log user/pass combo + // Get user/pass combo user, pass, ok := r.BasicAuth() if ok { // This also includes empty user/pass combos (if they are correctly encoded) // To avoid them, use `len(user) > 0 && len(pass) > 0` log.Printf("%s: %s %s:%s@%s%s", r.RemoteAddr, r.Method, user, pass, r.Host, r.URL.Path) + + // Raise stats + metrics_num_passwords++ } else { log.Printf("%s: %s %s%s", r.RemoteAddr, r.Method, r.Host, r.URL.Path) } |