From fcc45b1b28f5ec95e02dc9ee55fea3d0d2ebe4a9 Mon Sep 17 00:00:00 2001 From: fghwett <1058178245@qq.com> Date: Tue, 8 Mar 2022 16:50:15 +0800 Subject: [PATCH] change reverse url --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 9b2c869..5df8cf1 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,9 @@ import ( func fetchHandler(w http.ResponseWriter, r *http.Request) { path := r.URL.Path - path = fmt.Sprintf("https://gravatar.com%s", path) + path = fmt.Sprintf("https://secure.gravatar.com%s", path) + + fmt.Println("need reverse url: ", path) rpURL, _ := url.Parse(path) @@ -18,7 +20,7 @@ func fetchHandler(w http.ResponseWriter, r *http.Request) { director := proxy.Director proxy.Director = func(r *http.Request) { director(r) - r.Host = "gravatar.com" + r.Host = "secure.gravatar.com" } proxy.ServeHTTP(w, r) }