Skip to content

Commit

Permalink
fix nil client
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Jun 2, 2017
1 parent c241dd0 commit a2ae073
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func Flags() int {
}

func (r *Req) getTransport() *http.Transport {
trans, _ := r.client.Transport.(*http.Transport)
trans, _ := r.Client().Transport.(*http.Transport)
return trans
}

Expand All @@ -77,9 +77,9 @@ func EnableInsecureTLS(enable bool) {
func (r *Req) EnableCookie(enable bool) {
if enable {
jar, _ := cookiejar.New(nil)
r.client.Jar = jar
r.Client().Jar = jar
} else {
r.client.Jar = nil
r.Client().Jar = nil
}
}

Expand All @@ -90,7 +90,7 @@ func EnableCookie(enable bool) {

// SetTimeout sets the timeout for every request
func (r *Req) SetTimeout(d time.Duration) {
r.client.Timeout = d
r.Client().Timeout = d
}

// SetTimeout sets the timeout for every request
Expand Down

0 comments on commit a2ae073

Please sign in to comment.