|
@@ -18,9 +18,11 @@ func SetHeader(w http.ResponseWriter, key, value string) {
|
|
|
}
|
|
|
|
|
|
// Redirect redirect
|
|
|
-func Redirect(w http.ResponseWriter, url string) {
|
|
|
- w.Header().Set(`Location`, url)
|
|
|
- w.WriteHeader(http.StatusFound)
|
|
|
+func Redirect(w http.ResponseWriter, r *http.Request, url string) {
|
|
|
+ //w.Header().Set(`Location`, url)
|
|
|
+ //w.WriteHeader(http.StatusFound)
|
|
|
+
|
|
|
+ http.Redirect(w, r, url, http.StatusFound)
|
|
|
}
|
|
|
|
|
|
// WriteJSON response JSON data.
|