rakyll / hey

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

fix: default the retrieval of the Host header if passed using -H #278

Open shashanklmurthy opened 2 years ago

shashanklmurthy commented 2 years ago

Defaults the host header to the one passed using the -H option

Signed-off-by: Shashank Murthy shashank.murthy@olacabs.com

shashanklmurthy commented 2 years ago

@rakyll - for approval

jclegras commented 1 year ago

Overall, we have two possibilities to set the Host currently, --host and -H Host: blabla (the latter doesn't work currently indeed)

Nonetheless, why two possibilities for the same purpose ? I would agree with the fact that -H Host: blabla is the most common one

shashanklmurthy commented 1 year ago

@jclegras - The two ways of doing this does seem wonky but my assessment would be that since -H allows us to pass any arbitrary header, why should the tool explicitly choose to ignore only the Host header?

Whilst trying to use this to simulate a load test, I ran into an issue due to the host not being passed through the headers which I thought was a weird behaviour given that I was passing all the rest of the headers the same way and seeing them in the downstream application,

I would favour keeping the two options so that a user could do it one way or another (setting both -host and -H Host: blah would make the -host option take precedence) just to be safe.