diff --git a/proxy/handler.go b/proxy/handler.go index 081c6d5..261a1c5 100644 --- a/proxy/handler.go +++ b/proxy/handler.go @@ -68,6 +68,13 @@ func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 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://") { targetURL = targetPath } else {