aboutsummaryrefslogtreecommitdiff
path: root/pkg/utils/htmx.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/utils/htmx.go')
-rw-r--r--pkg/utils/htmx.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/utils/htmx.go b/pkg/utils/htmx.go
new file mode 100644
index 0000000..c4120f3
--- /dev/null
+++ b/pkg/utils/htmx.go
@@ -0,0 +1,11 @@
+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)
+}