From 26485a2307b14486c283e81eb424b38bb4522c18 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Mon, 15 Jul 2024 06:16:46 +0200 Subject: [PATCH] Fix error rendering --- server/error.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/error.go b/server/error.go index 4a8a277..7b0e95b 100644 --- a/server/error.go +++ b/server/error.go @@ -38,6 +38,10 @@ func httpErrorHandler(sc context.Context) echo.HTTPErrorHandler { code = http.StatusInternalServerError } + // make sure that HTMX selects and targets correct element + c.Response().Header().Add("HX-Retarget", "#content") + c.Response().Header().Add("HX-Reselect", "#content") + if err = c.HTML(code, buf.String()); err != nil { c.Logger().Error(err) }