optimize code

This commit is contained in:
bxd
2023-12-02 16:51:46 +08:00
parent 36a4432d71
commit 90356e076c
12 changed files with 316 additions and 213 deletions

View File

@@ -12,18 +12,6 @@ const (
AcceptLanguage = "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
)
// get default headers
func defaultHeaders() http.Header {
return http.Header{
"User-Agent": []string{UserAgent},
"Accept": []string{"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"},
"Accept-Encoding": []string{"gzip, deflate, br"},
"Accept-Language": []string{AcceptLanguage},
"Sec-Ch-Ua": []string{SecChUa},
"Sec-Ch-Ua-Mobile": []string{"?0"},
"Sec-Ch-Ua-Platform": []string{`"Windows"`},
}
}
func (obj *RequestOption) initHeaders() (http.Header, error) {
if obj.Headers == nil {
return nil, nil