From 104c2662b713d6408c84c5244602f5590ae9727e Mon Sep 17 00:00:00 2001 From: Mmx233 Date: Sun, 30 Oct 2022 14:40:23 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=8E=BB=E9=99=A4=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=20UA=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/login.go | 1 - go.mod | 1 - go.sum | 2 -- util/http.go | 7 ------- 4 files changed, 11 deletions(-) diff --git a/controllers/login.go b/controllers/login.go index f5dbb4e..6a04997 100644 --- a/controllers/login.go +++ b/controllers/login.go @@ -17,7 +17,6 @@ func Login(localAddr net.Addr, debugOutput bool) error { Meta: &global.Config.Meta, }, Client: util.HttpPackSelect(localAddr).Client, - Header: util.HttpPackSelect(localAddr).Header, } var output func(args ...interface{}) diff --git a/go.mod b/go.mod index d598f47..eee1a9a 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.19 require ( github.com/Mmx233/tool v0.6.8 github.com/antonfisher/nested-logrus-formatter v1.3.1 - github.com/corpix/uarand v0.2.0 github.com/howeyc/fsnotify v0.9.0 github.com/sirupsen/logrus v1.9.0 github.com/spf13/viper v1.13.0 diff --git a/go.sum b/go.sum index 12e7b4b..6c71e33 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,6 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/corpix/uarand v0.2.0 h1:U98xXwud/AVuCpkpgfPF7J5TQgr7R5tqT8VZP5KWbzE= -github.com/corpix/uarand v0.2.0/go.mod h1:/3Z1QIqWkDIhf6XWn/08/uMHoQ8JUoTIKc2iPchBOmM= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/util/http.go b/util/http.go index 2d2281b..9f7cfa3 100644 --- a/util/http.go +++ b/util/http.go @@ -3,14 +3,12 @@ package util import ( "github.com/Mmx233/BitSrunLoginGo/global" "github.com/Mmx233/tool" - "github.com/corpix/uarand" "net" "net/http" ) type Http struct { Client *http.Client - Header http.Header } var HttpPack *Http @@ -39,10 +37,6 @@ func HttpPackSelect(addr net.Addr) *Http { } func genHttpPack(addr net.Addr) *Http { - var header = make(http.Header, 2) - header.Add("User-Agent", uarand.GetRandom()) - header.Set("X-Requested-With", "XMLHttpRequest") - return &Http{ Client: tool.GenHttpClient(&tool.HttpClientOptions{ Transport: tool.GenHttpTransport(&tool.HttpTransportOptions{ @@ -52,6 +46,5 @@ func genHttpPack(addr net.Addr) *Http { }), Timeout: global.Timeout, }), - Header: header, } }