requests: nil pointer dereference panic was fixed [#25]
http.Do() method will return non-nil [error] in following cases: 1. Request is nil 2. Response missing Location header 3. Client failed to parse Location header 4. Method "request.GetBody()" returns error 5. Http.Client.Send() returns error 5. Client timeout was exceeded Signed-off-by: Christoph Polcin <labs@polcin.de>
This commit is contained in:
parent
3cd755d6c4
commit
a68e21e92b
@ -38,6 +38,9 @@ func (c *Client) req(method, path string, body io.Reader, intercept func(*http.R
|
||||
}
|
||||
|
||||
rs, err := c.c.Do(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if rs.StatusCode == 401 && c.auth.Type() == "NoAuth" {
|
||||
if strings.Index(rs.Header.Get("Www-Authenticate"), "Digest") > -1 {
|
||||
|
Loading…
Reference in New Issue
Block a user