Skip to content

Commit

Permalink
before write to output
Browse files Browse the repository at this point in the history
  • Loading branch information
iesreza committed Oct 19, 2022
1 parent cc1fa4e commit 731cefb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion evo.context.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Request struct {
CacheDuration time.Duration
Debug bool
flashes []flash
BeforeWrite func(request *Request)
BeforeWrite func(request *Request, body []byte) []byte
}
type flash struct {
Type string `json:"type"`
Expand Down
2 changes: 1 addition & 1 deletion fiber.context.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ func (r *Request) Write(body interface{}) {
}, r.CacheDuration)
}
if r.BeforeWrite != nil {
r.BeforeWrite(r)
data = r.BeforeWrite(r, data)
}
r.Context.Context().Response.SetBody(data)
}
Expand Down

0 comments on commit 731cefb

Please sign in to comment.