chore: support ETag for update geo

This commit is contained in:
wwqgtxx
2024-09-22 13:57:57 +08:00
parent 5d242510c8
commit b7cb6774bf
11 changed files with 117 additions and 51 deletions

View File

@@ -13,8 +13,10 @@ import (
"golang.org/x/exp/constraints"
)
const defaultHttpTimeout = time.Second * 90
func downloadForBytes(url string) ([]byte, error) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*90)
ctx, cancel := context.WithTimeout(context.Background(), defaultHttpTimeout)
defer cancel()
resp, err := mihomoHttp.HttpRequest(ctx, url, http.MethodGet, nil, nil)
if err != nil {