)
func RunCGIAndLog(host string, w http.ResponseWriter, r *http.Request, h *cgi.Handler) {
- wc := &godlighty.CountResponseWriter{ResponseWriter: w}
if r.TLS != nil && len(r.TLS.PeerCertificates) > 0 {
h.Env = append(h.Env, "TLSREMOTEDN="+r.TLS.PeerCertificates[0].Subject.String())
}
+ wc := &godlighty.CountResponseWriter{ResponseWriter: w}
h.ServeHTTP(wc, r)
fmt.Printf("%s %s \"%s %+q %s\" %d %d \"%s\"\n",
- r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
+ r.RemoteAddr, host, r.Method, godlighty.PathWithQuery(r.URL), r.Proto,
wc.Status, wc.Size,
r.Header.Get("User-Agent"),
)