mirror of
https://github.com/duanhf2012/origin.git
synced 2026-03-02 11:21:11 +08:00
优化代码
This commit is contained in:
@@ -468,12 +468,10 @@ 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)
|
|
||||||
http.SetCookie(*w,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
|
||||||
http.StatusTemporaryRedirect)
|
http.StatusTemporaryRedirect)
|
||||||
|
|||||||
Reference in New Issue
Block a user