Parcourir la source

fix append rawqurey to the redirect location.

Xiang Li il y a 12 ans
Parent
commit
6684186033
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  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) {
 	path := req.URL.Path
-	url := hostname + path
+	query := req.URL.RawQuery
+	url := hostname + path + "?" + query
 	log.Debugf("Redirect to %s", url)
 	http.Redirect(w, req, url, http.StatusTemporaryRedirect)
 }