mirror of
https://github.com/golang/go
synced 2024-11-22 05:14:40 -07:00
net/http: Fix nil pointer dereference in error case.
R=golang-dev CC=bradfitz, golang-dev https://golang.org/cl/5598044
This commit is contained in:
parent
dcbc77d2cf
commit
ed7a8f7159
@ -275,7 +275,7 @@ func (c *Client) Post(url string, bodyType string, body io.Reader) (r *Response,
|
|||||||
}
|
}
|
||||||
req.Header.Set("Content-Type", bodyType)
|
req.Header.Set("Content-Type", bodyType)
|
||||||
r, err = send(req, c.Transport)
|
r, err = send(req, c.Transport)
|
||||||
if c.Jar != nil {
|
if err == nil && c.Jar != nil {
|
||||||
c.Jar.SetCookies(req.URL, r.Cookies())
|
c.Jar.SetCookies(req.URL, r.Cookies())
|
||||||
}
|
}
|
||||||
return r, err
|
return r, err
|
||||||
|
Loading…
Reference in New Issue
Block a user