forked from mtusi2026/mtusi2026lab5
15 lines
320 B
Go
15 lines
320 B
Go
package middleware
|
|
|
|
import "github.com/labstack/echo/v4"
|
|
|
|
const HeaderInstanceID = "X-Instance-Id"
|
|
|
|
func InstanceID(id string) echo.MiddlewareFunc {
|
|
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
|
return func(c echo.Context) error {
|
|
c.Response().Header().Set(HeaderInstanceID, id)
|
|
return next(c)
|
|
}
|
|
}
|
|
}
|