mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-13 20:20:28 +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"
|
scheme = "https"
|
||||||
}
|
}
|
||||||
var host = req.URL.Host
|
var host = req.URL.Host
|
||||||
if len(host) > 0 {
|
if len(host) == 0 {
|
||||||
host = req.Host
|
host = req.Host
|
||||||
}
|
}
|
||||||
if !this.isFullURL {
|
if !this.isFullURL {
|
||||||
@@ -94,7 +94,8 @@ func (this *HTTPAuthSubRequestMethod) Filter(req *http.Request, doSubReq func(su
|
|||||||
return status >= 200 && status < 300, nil
|
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)
|
resp, err := httpAuthSubRequestHTTPClient.Do(newReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
|
|||||||
Reference in New Issue
Block a user