mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-05 17:13:32 +08:00
[Style] Add User-Agent for provider request
This commit is contained in:
parent
5317d6e3e6
commit
e1a1f87dd4
@ -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
|
||||
}
|
||||
|
5
common/net/http.go
Normal file
5
common/net/http.go
Normal file
@ -0,0 +1,5 @@
|
||||
package net
|
||||
|
||||
const (
|
||||
UA = "Clash"
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user