Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Body Parameter ignored for --http1 and --http2 flags. #32

Closed
brvi opened this issue Apr 9, 2018 · 2 comments
Closed

Body Parameter ignored for --http1 and --http2 flags. #32

brvi opened this issue Apr 9, 2018 · 2 comments

Comments

@brvi
Copy link

brvi commented Apr 9, 2018

I build bombardier from source using go1.10.1 darwin/amd64. I also cross compiled to linux/amd64.

What version of bombardier are you using?

db65d7c4537354aabece20b1fbd0127f51145f11

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

linux/amd64 & darwin/amd64

What did you do?

I noticed requests failing when using the --http1 flag, so I used requestbin to log and inspect requests. Turns out that anything passed in via both the --bodyand --body-file flags gets ignored for --http1 and --http2 flags. I verified this by removing those flags and the requests passed through properly.

What you expected to happen?

I expect the body to be passed through in post requests when not utilizing fast-http

What actually happened?

The body parameters weren't passed through.

P.S. Thanks for creating this awesome tool.

codesenberg added a commit that referenced this issue Apr 10, 2018
Set ContentLength explicitly for net/http, so the bodies are sent in
"one piece" and not using chunked transfer encoding, when streaming
is off.

Updates #32.
@codesenberg
Copy link
Owner

codesenberg commented Apr 10, 2018

Ok, I've investigated this a bit and found out that requestbin doesn't display bodies of requests that are sent using chunked transfer encoding (Transfer-Encoding: chunked). So, actually, the bodies are sent, but you can't see them in requestbin's request log.
Another thing I found is that net/http uses chunked transfer encoding where it shouldn't. This is fixed now, so you will be able to see bodies in requestbin's request log, unless you turn streaming on (--stream flag).

@codesenberg codesenberg modified the milestone: v1.2 Apr 10, 2018
@brvi
Copy link
Author

brvi commented Apr 10, 2018

Wow! Thank you for your thorough investigation, explanation and resolution!

@brvi brvi closed this as completed Apr 10, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants