framework/pkg/utils/htmx.go

12 lines
253 B
Go
Raw Normal View History

2024-10-12 02:52:22 +03:00
package utils
import "github.com/labstack/echo/v4"
func IsHTMX(c echo.Context) bool {
return c.Request().Header.Get("HX-Request") == "true"
}
func HTMXRedirect(c echo.Context, location string) {
c.Response().Header().Set("HX-Redirect", location)
}