]> Sergey Matveev's repositories - godlighty.git/blobdiff - rc/redirect.go
Better URL escaping in output
[godlighty.git] / rc / redirect.go
index 2039a076cd0e5f394d1e68f86ef97cebdcc2accd..677479f61560fbccc41fd6e1c586733542043a27 100644 (file)
@@ -20,6 +20,8 @@ package rc
 import (
        "fmt"
        "net/http"
+
+       "go.stargrave.org/godlighty"
 )
 
 func Redirect(
@@ -29,7 +31,7 @@ func Redirect(
 ) {
        http.Redirect(w, r, to, status)
        fmt.Printf("%s %s \"%s %+q %s\" %d \"%s\"\n",
-               r.RemoteAddr, host, r.Method, r.URL.Path, r.Proto,
+               r.RemoteAddr, host, r.Method, godlighty.PathWithQuery(r.URL), r.Proto,
                status, r.Header.Get("User-Agent"),
        )
 }