Skip to content

Commit

Permalink
🐛 fix: respect Immutable config for Body()
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Jackson committed Dec 12, 2024
1 parent 8c84b0f commit 9d0ddae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,11 @@ func (c *Ctx) Body() []byte {
// rule defined at: https://www.rfc-editor.org/rfc/rfc9110#section-8.4-5
encodingOrder = getSplicedStrList(headerEncoding, encodingOrder)
if len(encodingOrder) == 0 {
return c.fasthttp.Request.Body()
body = c.fasthttp.Request.Body()
if c.app.config.Immutable {
return utils.CopyBytes(body)
}
return body
}

var decodesRealized uint8
Expand Down

0 comments on commit 9d0ddae

Please sign in to comment.