diff --git a/internal/httpdb/httpdb.go b/internal/httpdb/httpdb.go index 53a3d33..d98cbde 100644 --- a/internal/httpdb/httpdb.go +++ b/internal/httpdb/httpdb.go @@ -148,6 +148,14 @@ func (d *Data) Header(key string) string { return d.r.Header.Get(key) } +func (d *Data) Cookie(key string) string { + c, err := d.r.Cookie(key) + if err != nil { + return "" + } + return c.Value +} + func renderTemplate(t string, data interface{}) (string, error) { tpl, err := template.New("").Parse(t) if err != nil {