diff --git a/proxy/handler.go b/proxy/handler.go index f7fe17f..21b33c3 100644 --- a/proxy/handler.go +++ b/proxy/handler.go @@ -3,6 +3,7 @@ package proxy import ( "compress/gzip" + "bytes" "io" "log" "net/http" @@ -123,6 +124,13 @@ func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } + if r.Method == "POST" || r.Method == "PUT" || r.Method == "PATCH" { + if r.Body != nil { + body, _ := io.ReadAll(r.Body) + proxyReq.Body = io.NopCloser(bytes.NewReader(body)) + proxyReq.ContentLength = int64(len(body)) + } + } h.setProxyHeaders(proxyReq, r) client := &http.Client{