]> Sergey Matveev's repositories - godlighty.git/blobdiff - rc/redirect.go
Update zstd
[godlighty.git] / rc / redirect.go
index 2039a076cd0e5f394d1e68f86ef97cebdcc2accd..f98439e9e1f890423b736cbfc0100bf02b825044 100644 (file)
@@ -1,25 +1,25 @@
-/*
-godlighty -- highly-customizable HTTP, HTTP/2, HTTPS server
-Copyright (C) 2021 Sergey Matveev <stargrave@stargrave.org>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 3 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
+// godlighty -- highly-customizable HTTP, HTTP/2, HTTPS server
+// Copyright (C) 2021-2024 Sergey Matveev <stargrave@stargrave.org>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 3 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 package rc
 
 import (
        "fmt"
        "net/http"
+
+       "go.stargrave.org/godlighty"
 )
 
 func Redirect(
@@ -29,7 +29,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"),
        )
 }