We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 046b741 commit 844bc71Copy full SHA for 844bc71
binding/receiver.go
@@ -99,12 +99,15 @@ func (r *receiver) getBodyCodec(req *http.Request) codec {
99
}
100
101
func (r *receiver) getBody(req *http.Request) ([]byte, string, error) {
102
- if r.hasBody && (req.Method == "POST" || req.Method == "PUT" || req.Method == "PATCH") {
103
- bodyBytes, err := copyBody(req)
104
- if err == nil {
105
- return bodyBytes, goutil.BytesToString(bodyBytes), nil
+ if r.hasBody {
+ switch req.Method {
+ case "POST", "PUT", "PATCH", "DELETE":
+ bodyBytes, err := copyBody(req)
106
+ if err == nil {
107
+ return bodyBytes, goutil.BytesToString(bodyBytes), nil
108
+ }
109
+ return bodyBytes, "", nil
110
- return bodyBytes, "", nil
111
112
return nil, "", nil
113
0 commit comments