Finihes Unit testing

This commit is contained in:
2015-08-13 10:11:08 +02:00
parent 5ef16a7afc
commit bf5ba9a46f
2 changed files with 152 additions and 21 deletions

View File

@@ -50,7 +50,12 @@ func (l *Logger) Wrap() func(chain.Handler) chain.Handler {
uAgent = strings.Join(uAgentList, "; ")
}
l.Printf("Requested %s on %s from %s (User-Agent: %s)", r.Method, r.URL.Path, r.RemoteAddr, uAgent)
remote := r.RemoteAddr
if len(remote) == 0 {
remote = "<unknown>"
}
l.Printf("Requested %s on %s from %s (User-Agent: %s)", r.Method, r.URL.Path, remote, uAgent)
//wrap the request with our own interface
hh := WrapResponseWritter(h)