mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-14 15:40:24 +08:00
尝试根据端口号自动纠正源站地址中的scheme
This commit is contained in:
@@ -275,6 +275,13 @@ func (this *HTTPRequest) doOriginRequest(failedOriginIds []int64, failedLnNodeId
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 尝试自动纠正源站地址中的scheme
|
||||||
|
if this.RawReq.URL.Scheme == "http" && strings.HasSuffix(originAddr, ":443") {
|
||||||
|
this.RawReq.URL.Scheme = "https"
|
||||||
|
} else if this.RawReq.URL.Scheme == "https" && strings.HasSuffix(originAddr, ":80") {
|
||||||
|
this.RawReq.URL.Scheme = "http"
|
||||||
|
}
|
||||||
|
|
||||||
// 开始请求
|
// 开始请求
|
||||||
resp, requestErr = client.Do(this.RawReq)
|
resp, requestErr = client.Do(this.RawReq)
|
||||||
} else if origin.OSS != nil { // OSS源站
|
} else if origin.OSS != nil { // OSS源站
|
||||||
|
|||||||
Reference in New Issue
Block a user