Pārlūkot izejas kodu

fix append rawqurey to the redirect location.

Xiang Li 12 gadi atpakaļ
vecāks
revīzija
6684186033
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      server/util.go

+ 2 - 1
server/util.go

@@ -20,7 +20,8 @@ func decodeJsonRequest(req *http.Request, data interface{}) error {
 
 
 func redirect(hostname string, w http.ResponseWriter, req *http.Request) {
 func redirect(hostname string, w http.ResponseWriter, req *http.Request) {
 	path := req.URL.Path
 	path := req.URL.Path
-	url := hostname + path
+	query := req.URL.RawQuery
+	url := hostname + path + "?" + query
 	log.Debugf("Redirect to %s", url)
 	log.Debugf("Redirect to %s", url)
 	http.Redirect(w, req, url, http.StatusTemporaryRedirect)
 	http.Redirect(w, req, url, http.StatusTemporaryRedirect)
 }
 }