diff --git a/go.mod b/go.mod index 0815ead..a039305 100644 --- a/go.mod +++ b/go.mod @@ -5,4 +5,5 @@ go 1.16 require ( github.com/AdguardTeam/dnsproxy v0.37.7 github.com/miekg/dns v1.1.43 + golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 ) diff --git a/wndclient/jar.go b/wndclient/jar.go index 106504c..5bf5d76 100644 --- a/wndclient/jar.go +++ b/wndclient/jar.go @@ -1,4 +1,4 @@ -package seclient +package wndclient import ( "net/http" diff --git a/wndclient/wndclient.go b/wndclient/wndclient.go index 43320fe..38473d5 100644 --- a/wndclient/wndclient.go +++ b/wndclient/wndclient.go @@ -7,7 +7,7 @@ import ( "io" "io/ioutil" "net/http" - "net/url" + //"net/url" "sync" ) @@ -84,7 +84,7 @@ func NewWndClient(transport http.RoundTripper) (*WndClient, error) { return nil, err } - return &SEClient{ + return &WndClient{ httpClient: &http.Client{ Jar: jar, Transport: transport, @@ -93,13 +93,13 @@ func NewWndClient(transport http.RoundTripper) (*WndClient, error) { }, nil } -func (c *SEClient) ResetCookies() error { +func (c *WndClient) ResetCookies() error { c.Mux.Lock() defer c.Mux.Unlock() return c.resetCookies() } -func (c *SEClient) resetCookies() error { +func (c *WndClient) resetCookies() error { return (c.httpClient.Jar.(*StdJar)).Reset() }