Skip to content

Commit

Permalink
coprocess: take RawBodyOnly flag directly from middleware settings
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasinsaurralde committed Jun 14, 2019
1 parent 3c736e0 commit df8440d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gateway/coprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ func (c *CoProcessor) ObjectFromRequest(r *http.Request) (*coprocess.Object, err
ReturnOverrides: &coprocess.ReturnOverrides{
ResponseCode: -1,
},
Method: r.Method,
RequestUri: r.RequestURI,
Scheme: scheme,
RawBodyOnly: c.Middleware.RawBodyOnly,
Method: r.Method,
RequestUri: r.RequestURI,
Scheme: scheme,
}

if r.Body != nil {
Expand All @@ -108,7 +107,7 @@ func (c *CoProcessor) ObjectFromRequest(r *http.Request) (*coprocess.Object, err
if err != nil {
return nil, err
}
if utf8.Valid(miniRequestObject.RawBody) && !miniRequestObject.RawBodyOnly {
if utf8.Valid(miniRequestObject.RawBody) && !c.Middleware.RawBodyOnly {
miniRequestObject.Body = string(miniRequestObject.RawBody)
}
}
Expand Down

0 comments on commit df8440d

Please sign in to comment.