server: Add "Referer" to log entry when host not found

This commit is contained in:
Matthew Holt 2016-02-19 13:34:54 -07:00
parent 09a7af8cae
commit f7b5187bf3

View file

@ -331,7 +331,8 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
fmt.Fprintf(w, "No such host at %s", s.Server.Addr)
log.Printf("[INFO] %s - No such host at %s (requested by %s)", host, s.Server.Addr, remoteHost)
log.Printf("[INFO] %s - No such host at %s (Remote: %s, Referer: %s)",
host, s.Server.Addr, remoteHost, r.Header.Get("Referer"))
}
}