Skip to content

Commit

Permalink
tpl/data: Add default user-agent header for getJSON requests
Browse files Browse the repository at this point in the history
  • Loading branch information
peacecwz authored Feb 1, 2021
1 parent 2f9dada commit 35def0a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tpl/data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func (ns *Namespace) GetJSON(urlParts ...interface{}) (interface{}, error) {
}

req.Header.Add("Accept", "application/json")
req.Header.Add("User-Agent", "Hugo Static Site Generator")

err = ns.getResource(cache, unmarshal, req)
if err != nil {
Expand Down

0 comments on commit 35def0a

Please sign in to comment.