diff --git a/internal/glance/widget-custom-api.go b/internal/glance/widget-custom-api.go index e51a233..3848425 100644 --- a/internal/glance/widget-custom-api.go +++ b/internal/glance/widget-custom-api.go @@ -679,6 +679,20 @@ var customAPITemplateFuncs = func() template.FuncMap { req.BodyType = "string" return req }, + "withAllowInsecure": func(val any, req *CustomAPIRequest) *CustomAPIRequest { + switch v := val.(type) { + case bool: + req.AllowInsecure = v + case string: + if strings.ToLower(v) == "true" { + req.AllowInsecure = true + } + default: + slog.Warn("withAllowInsecure called with non-boolean value, must be string or bool", "value", v) + } + + return req + }, "getResponse": func(req *CustomAPIRequest) *customAPIResponseData { err := req.initialize() if err != nil {