r.Host = host
resp, err := http.DefaultClient.Do(r)
if err != nil {
- fmt.Printf("%s %s \"%s %s %s\" %d \"%s\" \"%s\"\n",
- r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
- http.StatusBadGateway, err.Error(),
+ fmt.Printf("%s %s \"%s %+q %s\" %d \"%s\" \"%s\"\n",
+ r.RemoteAddr, host, r.Method, godlighty.PathWithQuery(r.URL),
+ r.Proto, http.StatusBadGateway, err.Error(),
r.Header.Get("User-Agent"),
)
http.Error(w, err.Error(), http.StatusBadGateway)
w.WriteHeader(resp.StatusCode)
size, _ := io.Copy(w, resp.Body)
resp.Body.Close()
- fmt.Printf("%s %s \"%s %s %s\" %d %d \"%s\"\n",
- r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
- resp.StatusCode, size,
+ fmt.Printf("%s %s \"%s %+q %s\" %d %d \"%s\"\n",
+ r.RemoteAddr, host, r.Method, godlighty.PathWithQuery(r.URL),
+ r.Proto, resp.StatusCode, size,
r.Header.Get("User-Agent"),
)
return true