host string, cfg *HostCfg,
) {
notFound := func() {
- fmt.Printf("%s %s \"%s %s %s\" %d \"%s\"\n",
+ fmt.Printf("%s %s \"%s %+q %s\" %d \"%s\"\n",
r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
http.StatusNotFound,
r.Header.Get("User-Agent"),
username = "user:" + username + " "
}
printErr := func(code int, err error) {
- fmt.Printf("%s %s \"%s %s %s\" %d \"%s\" %s\"%s\"\n",
+ fmt.Printf("%s %s \"%s %+q %s\" %d \"%s\" %s\"%s\"\n",
r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
code, err.Error(),
username, r.Header.Get("User-Agent"),
}
wc := &CountResponseWriter{ResponseWriter: w}
dav.ServeHTTP(wc, r)
- fmt.Printf("%s %s \"WebDAV %s\" %d %d %s\"%s\"\n",
+ fmt.Printf("%s %s \"WebDAV %+q\" %d %d %s\"%s\"\n",
r.RemoteAddr, host, r.URL.Path,
wc.Status, wc.Size,
username, r.Header.Get("User-Agent"),
}
if !(r.Method == "" || r.Method == http.MethodGet) {
- fmt.Printf("%s %s \"%s %s %s\" %d %s\"%s\"\n",
+ fmt.Printf("%s %s \"%s %+q %s\" %d %s\"%s\"\n",
r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
http.StatusMethodNotAllowed,
username, r.Header.Get("User-Agent"),
wr := wc.(*gzipResponseWriter)
w.WriteHeader(wr.status)
w.Write(bufCompressed.Bytes())
- fmt.Printf("%s %s \"%s %s %s\" %d %d %s\"%s\"\n",
+ fmt.Printf("%s %s \"%s %+q %s\" %d %d %s\"%s\"\n",
r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
wr.status, size,
username, r.Header.Get("User-Agent"),
return
}
wr := wc.(*CountResponseWriter)
- fmt.Printf("%s %s \"%s %s %s\" %d %d %s\"%s\"\n",
+ fmt.Printf("%s %s \"%s %+q %s\" %d %d %s\"%s\"\n",
r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
wr.Status, wr.Size,
username, r.Header.Get("User-Agent"),
r.Host = host
resp, err := http.DefaultClient.Do(r)
if err != nil {
- fmt.Printf("%s %s \"%s %s %s\" %d \"%s\" \"%s\"\n",
+ fmt.Printf("%s %s \"%s %+q %s\" %d \"%s\" \"%s\"\n",
r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
http.StatusBadGateway, err.Error(),
r.Header.Get("User-Agent"),
w.WriteHeader(resp.StatusCode)
size, _ := io.Copy(w, resp.Body)
resp.Body.Close()
- fmt.Printf("%s %s \"%s %s %s\" %d %d \"%s\"\n",
+ fmt.Printf("%s %s \"%s %+q %s\" %d %d \"%s\"\n",
r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
resp.StatusCode, size,
r.Header.Get("User-Agent"),