Skip to content

Instantly share code, notes, and snippets.

@sumanentc
Created October 4, 2019 09:31
Show Gist options
  • Save sumanentc/705df765e991e5100aac477c575196d2 to your computer and use it in GitHub Desktop.
Save sumanentc/705df765e991e5100aac477c575196d2 to your computer and use it in GitHub Desktop.
//Custom Middleware
// ServerHeader middleware adds a custom header to the response.
func serverHeader(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
c.Response().Header().Set("Custom-Header", "blah!!!")
return next(c)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment