mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-17 19:00:25 +08:00
自动替换Location中的地址时检查域名是否为当前域名
This commit is contained in:
@@ -283,7 +283,7 @@ func (this *HTTPRequest) doReverseProxy() {
|
||||
var locationHeader = resp.Header.Get("Location")
|
||||
if len(locationHeader) > 0 {
|
||||
locationURL, err := url.Parse(locationHeader)
|
||||
if err == nil && (locationURL.Host == originAddr || strings.HasPrefix(originAddr, locationURL.Host+":")) {
|
||||
if err == nil && locationURL.Host != this.ReqHost && (locationURL.Host == originAddr || strings.HasPrefix(originAddr, locationURL.Host+":")) {
|
||||
locationURL.Host = this.ReqHost
|
||||
if this.IsHTTP {
|
||||
locationURL.Scheme = "http"
|
||||
|
||||
Reference in New Issue
Block a user