更新 proxy/handler.go
This commit is contained in:
@@ -68,6 +68,13 @@ func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
var targetURL string
|
var targetURL string
|
||||||
|
|
||||||
|
if strings.HasPrefix(targetPath, "http:/") && !strings.HasPrefix(targetPath, "http://") {
|
||||||
|
targetPath = strings.Replace(targetPath, "http:/", "http://", 1)
|
||||||
|
}
|
||||||
|
if strings.HasPrefix(targetPath, "https:/") && !strings.HasPrefix(targetPath, "https://") {
|
||||||
|
targetPath = strings.Replace(targetPath, "https:/", "https://", 1)
|
||||||
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(targetPath, "http://") || strings.HasPrefix(targetPath, "https://") {
|
if strings.HasPrefix(targetPath, "http://") || strings.HasPrefix(targetPath, "https://") {
|
||||||
targetURL = targetPath
|
targetURL = targetPath
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user