wndclient: deps and fixes

This commit is contained in:
Vladislav Yarmak
2021-06-23 18:44:44 +03:00
parent f665fe1539
commit 58b7c53ef0
3 changed files with 6 additions and 5 deletions

1
go.mod
View File

@@ -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
)

View File

@@ -1,4 +1,4 @@
package seclient
package wndclient
import (
"net/http"

View File

@@ -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()
}