mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-22 05:40:50 +02:00
* feat: custom user agent (#990)
* fix: move build meta to own package this allows it to be referenced from other packages without causing a cyclic dependency * feat: custom user agent
This commit is contained in:
parent
b196629d04
commit
f508c92ae0
6 changed files with 59 additions and 12 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/containrrr/watchtower/internal/meta"
|
||||
"github.com/containrrr/watchtower/pkg/registry/auth"
|
||||
"github.com/containrrr/watchtower/pkg/registry/manifest"
|
||||
"github.com/containrrr/watchtower/pkg/types"
|
||||
|
@ -86,6 +87,7 @@ func GetDigest(url string, token string) (string, error) {
|
|||
client := &http.Client{Transport: tr}
|
||||
|
||||
req, _ := http.NewRequest("HEAD", url, nil)
|
||||
req.Header.Set("User-Agent", meta.UserAgent)
|
||||
|
||||
if token != "" {
|
||||
logrus.WithField("token", token).Trace("Setting request token")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue