fix: make HTTP user agents configurable and remove tool identifiers

This commit is contained in:
ji ruo committed 2026-11-11 18:56:33 +08:00
1 parent 40746901db
commit 17c2fc5e08
30 files changed
+1204 -26

No files matched your search

+3 -1
View File
@@ -9,6 +9,8 @@ import (
"strconv"
"strings"
"time"
"github.com/Autumn-27/artex/internal/httpidentity"
)
// Repo 是发布源。写死而不是做成配置项:更新源可配等于给任何能改配置的人一条
@@ -125,7 +127,7 @@ func FetchLatest(ctx context.Context, c *http.Client) (*Release, error) {
return nil, err
}
req.Header.Set("Accept", "application/vnd.github+json")
req.Header.Set("User-Agent", "artex-selfupdate")
httpidentity.ApplyRequired(req)
resp, err := c.Do(req)
if err != nil {