Skip to content

Commit

Permalink
improve html-doc: add MetaCSRFToken
Browse files Browse the repository at this point in the history
  • Loading branch information
denisskin committed Sep 28, 2020
1 parent 28a261e commit f813d71
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions document.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,13 @@ func (d *Document) MetaDescription() string {
return ""
}

func (d *Document) MetaCSRFToken() string {
if e := d.MetaTags().FilterByAttrValue("name", "csrf-token").First(); e != nil {
return e.Attributes["content"]
}
return ""
}

// MetaIcon gets image-url from meta-info for html-document
func (d *Document) MetaIcon() string {
linkTags := d.GetElementsByTagName("link").FilterByAttr("href")
Expand Down

0 comments on commit f813d71

Please sign in to comment.