This commit is contained in:
2022-02-23 19:52:56 +08:00
parent 0d5b801c78
commit ab9065d0ed

View File

@@ -82,10 +82,11 @@ func httpHandler(w http.ResponseWriter, r *http.Request, pathname string) {
} }
func proxy(w http.ResponseWriter, r *http.Request, client *http.Client, pathname string) { func proxy(w http.ResponseWriter, r *http.Request, client *http.Client, pathname string) {
fmt.Println("Proxy: ", pathname) fmt.Println("Proxy: ", pathname, "Method: ", r.Method)
req, _ := http.NewRequest(r.Method, pathname, r.Body) req, _ := http.NewRequest(r.Method, pathname, r.Body)
for k, v := range r.Header { for k, v := range r.Header {
req.Header.Set(k, strings.Join(v, ",")) req.Header.Set(k, strings.Join(v, ","))
fmt.Println("Header: ", k, ":", strings.Join(v, ","))
} }
res, e := client.Do(req) res, e := client.Do(req)
if e != nil { if e != nil {