diff --git a/htmx_route.go b/htmx_route.go index 178cce8..2c35f79 100644 --- a/htmx_route.go +++ b/htmx_route.go @@ -33,12 +33,15 @@ type HtmxContext interface { SetPathTemplate(pathTemplate string) GetPathParam(key string, defaultValue ...string) string GetFormValue(key string) string + GetHeaderValue(key string) string SetHeader(key string, value string) SetAllRoutes(routes []HtmxRoute) GetAllRoutes() []HtmxRoute GetQueryParams() []HtmxPathParam GetAuthContext() (bool, AuthContext) GetGoContext() context.Context + GetRequest() *http.Request + GetResponseWriter() http.ResponseWriter } type HtmxContextImpl struct { @@ -50,6 +53,18 @@ type HtmxContextImpl struct { routes []HtmxRoute } +func (c *HtmxContextImpl) GetResponseWriter() http.ResponseWriter { + return c.res +} + +func (c *HtmxContextImpl) GetRequest() *http.Request { + return c.req +} + +func (c *HtmxContextImpl) GetHeaderValue(key string) string { + return c.req.Header.Get(key) +} + func (c *HtmxContextImpl) GetGoContext() context.Context { return c.req.Context() }