mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-19 02:44:42 +08:00
修改重定向
This commit is contained in:
@@ -468,9 +468,11 @@ func (slf *HttpRespone) Redirect(url string,cookieList []*http.Cookie) {
|
|||||||
func (slf *HttpRespone) redirects(w *http.ResponseWriter, req *http.Request) {
|
func (slf *HttpRespone) redirects(w *http.ResponseWriter, req *http.Request) {
|
||||||
if slf.RedirectData.CookieList != nil {
|
if slf.RedirectData.CookieList != nil {
|
||||||
for _,v := range slf.RedirectData.CookieList{
|
for _,v := range slf.RedirectData.CookieList{
|
||||||
req.AddCookie(v)
|
//req.AddCookie(v)
|
||||||
|
http.SetCookie(*w,v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//http.SetCookie()
|
||||||
|
|
||||||
http.Redirect(*w, req, slf.RedirectData.Url,
|
http.Redirect(*w, req, slf.RedirectData.Url,
|
||||||
// see @andreiavrammsd comment: often 307 > 301
|
// see @andreiavrammsd comment: often 307 > 301
|
||||||
|
|||||||
Reference in New Issue
Block a user