rakyll / hey

HTTP load generator, ApacheBench (ab) replacement
Apache License 2.0
18k stars 1.19k forks source link

prevent panics when a RequestFunc rather than a Request is passed in #217

Closed raymonstah closed 2 years ago

raymonstah commented 4 years ago

When clients set up a requester.Work with a RequestFunc instead of a Request, we panic because we try to access the Host field on a nil Request.

I think we can omit setting the TLSClientConfig.ServerName since there seems to be a fallback for that.

I also added a test for RequestFunc

raymonstah commented 3 years ago

@rakyll thoughts on this?