mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 05:00:24 +08:00 
			
		
		
		
	子查询认证时Referer传递完整的URL
This commit is contained in:
		@@ -70,7 +70,7 @@ func (this *HTTPAuthSubRequestMethod) Filter(req *http.Request, doSubReq func(su
 | 
			
		||||
		scheme = "https"
 | 
			
		||||
	}
 | 
			
		||||
	var host = req.URL.Host
 | 
			
		||||
	if len(host) > 0 {
 | 
			
		||||
	if len(host) == 0 {
 | 
			
		||||
		host = req.Host
 | 
			
		||||
	}
 | 
			
		||||
	if !this.isFullURL {
 | 
			
		||||
@@ -94,7 +94,8 @@ func (this *HTTPAuthSubRequestMethod) Filter(req *http.Request, doSubReq func(su
 | 
			
		||||
		return status >= 200 && status < 300, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	newReq.Header.Set("Referer", req.URL.String())
 | 
			
		||||
	// TODO 需要将Header和StatusCode、ResponseBody输出到客户端
 | 
			
		||||
	newReq.Header.Set("Referer", scheme+"://"+host+req.URL.RequestURI())
 | 
			
		||||
	resp, err := httpAuthSubRequestHTTPClient.Do(newReq)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return false, err
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user