mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-09 12:00:26 +08:00
如果Header中Location字段含有跟源站一样的地址,则自动修改为当前域名
This commit is contained in:
@@ -142,11 +142,12 @@ func (this *HTTPClientPool) Client(req *HTTPRequest,
|
||||
rawClient = &http.Client{
|
||||
Timeout: readTimeout,
|
||||
Transport: transport,
|
||||
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||
CheckRedirect: func(targetReq *http.Request, via []*http.Request) error {
|
||||
// 是否跟随
|
||||
if followRedirects {
|
||||
var schemeIsSame = true
|
||||
for _, r := range via {
|
||||
if r.URL.Scheme != req.URL.Scheme {
|
||||
if r.URL.Scheme != targetReq.URL.Scheme {
|
||||
schemeIsSame = false
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user