更新 proxy/handler.go
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user