codesenberg / bombardier

Fast cross-platform HTTP benchmarking tool written in Go
MIT License
6.03k stars 315 forks source link

Bombardier checks hostname plausibility when it shouldn't #39

Closed nielsole closed 6 years ago

nielsole commented 6 years ago

What version of bombardier are you using?

in case you've built bombardier yourself or version obtained by

# bombardier --version
bombardier version v1.2 linux/amd64

in case you are using binaries.

What operating system and processor architecture are you using (if relevant)?

linux/amd64

What did you do?

# bombardier http://www-service/
host www-service: invalid host

Describe steps that can be used to reproduce the error.

What you expected to happen?

Bombardier would try to resolve www-service which is a valid DNS name in my setup.

What actually happened?

Bombardier quits with the message:

host www-service: invalid host

I couldn't find the error message in the source code, so I think it is some vendor bug trying to validate domains even though they shouldn't. www-service.default which is also a valid DNS name works fine.

nielsole commented 6 years ago

OK, so this apparently comes from https://github.com/codesenberg/bombardier/blob/b75865bb27593a174f5ed3c93b72f9b8d3d019c6/config.go#L87

I guess the problem lies here:

https://github.com/goware/urlx/blob/06d8eeb3ce171b5617a3f8ef24451df26ca971ef/urlx.go#L66-L77

Only allowing localhost hostname seems weird

codesenberg commented 6 years ago

Hi, @nielsole, I just pushed a fix for this issue to this branch. I assume you know how to build Go code. Can you check whether the fix is working properly for you?

nielsole commented 6 years ago

Sorry, I was gone for a month. The fix LGTM :+1:

codesenberg commented 6 years ago

@nielsole, sure, no problem. I merged the fix into the master, so you can close the issue if it's been resolved.