]> Sergey Matveev's repositories - godlighty.git/blobdiff - rc/example.cfg/proxied-host.go
Better URL escaping in output
[godlighty.git] / rc / example.cfg / proxied-host.go
index 5b61c4ddda343fae06699eee4d20a4ee380ca14e..a11f728b61cea2e4c5ca33deea457e3acf0cfabf 100644 (file)
@@ -20,8 +20,8 @@ func init() {
                                resp, err := http.DefaultClient.Do(r)
                                if err != nil {
                                        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.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)
@@ -36,8 +36,8 @@ func init() {
                                size, _ := io.Copy(w, resp.Body)
                                resp.Body.Close()
                                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.RemoteAddr, host, r.Method, godlighty.PathWithQuery(r.URL),
+                                       r.Proto, resp.StatusCode, size,
                                        r.Header.Get("User-Agent"),
                                )
                                return true