mirror of
https://github.com/golang/go
synced 2024-11-21 23:24:41 -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)
|
||||
r, err = send(req, c.Transport)
|
||||
if c.Jar != nil {
|
||||
if err == nil && c.Jar != nil {
|
||||
c.Jar.SetCookies(req.URL, r.Cookies())
|
||||
}
|
||||
return r, err
|
||||
|
Loading…
Reference in New Issue
Block a user