diff --git a/adapter/provider/vehicle.go b/adapter/provider/vehicle.go index 4f08c317..a0237a92 100644 --- a/adapter/provider/vehicle.go +++ b/adapter/provider/vehicle.go @@ -9,6 +9,7 @@ import ( "os" "time" + netHttp "github.com/Dreamacro/clash/common/net" "github.com/Dreamacro/clash/component/dialer" types "github.com/Dreamacro/clash/constant/provider" ) @@ -56,6 +57,8 @@ func (h *HTTPVehicle) Read() ([]byte, error) { } req, err := http.NewRequest(http.MethodGet, uri.String(), nil) + req.Header.Set("user-agent", netHttp.UA) + if err != nil { return nil, err } diff --git a/common/net/http.go b/common/net/http.go new file mode 100644 index 00000000..ae10f7fc --- /dev/null +++ b/common/net/http.go @@ -0,0 +1,5 @@ +package net + +const ( + UA = "Clash" +)