0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-02-24 23:57:05 -05:00

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"))
}
}