Skip to content

Middleware before writing a response and after handler #1127

@faisalraja

Description

@faisalraja

How would I create a middleware that calls a function after a handler executes but before the response is written?

An example usage is if I create a custom context that has Session map that get's modified in a handler. Calling a sess.Save(c.Request(), c.Response()) after next(c) doesn't work. My guess is since the response has already been written by c.JSON(...).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions