When I tried to use this library with concurrent api calls, I sometimes get an error 401.
url, user, password := "http://www.example.com/secrets", "robpike", "pw123"
client := &http.Client{
Transport: ntlmssp.Negotiator{
RoundTripper:&http.Transport{},
},
}
var wg sync.WaitGroup
for i := 0; i < 10; i++ {
wg.Add(1)
go func() {
defer wg.Done()
req, _ := http.NewRequest("GET", url, nil)
req.SetBasicAuth(user, password)
res, _ := client.Do(req)
fmt.Println(resp.StatusCode)
}()
}
wg.Wait()
If I make sure that the client only uses 1 active connection, I don't get any error. So I'm guessing this is a bug, right?
client := &http.Client{
Transport: ntlmssp.Negotiator{
RoundTripper:&http.Transport{
MaxConnsPerHost: 1, // limit connections
},
},
}
When I tried to use this library with concurrent api calls, I sometimes get an error 401.
If I make sure that the client only uses 1 active connection, I don't get any error. So I'm guessing this is a bug, right?