package middleware import ( "github.com/labstack/echo/v5" ) // DeprecationMiddleware adds deprecation warning to responses // for old endpoints that are being phased out in favor of /api/v1/* func DeprecationMiddleware(next echo.HandlerFunc) echo.HandlerFunc { return func(c *echo.Context) error { // Add deprecation warning header c.Response().Header().Add("Warning", `299 - "Deprecated: This endpoint is deprecated. Use /api/v1/ endpoints instead."`) c.Response().Header().Add("Deprecation", "true") return next(c) } }