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

Setting fastapi http method not working with additional headers #110

Open
makubit opened this issue Jun 28, 2024 · 0 comments
Open

Setting fastapi http method not working with additional headers #110

makubit opened this issue Jun 28, 2024 · 0 comments

Comments

@makubit
Copy link

makubit commented Jun 28, 2024

What version of bombardier are you using?

Current master (local build) -> 3ddcb83

It affects all of the architectures.

What did you do?

  1. Run the following command:
./bombardier-darwin-arm64 --connections=5 --requests=10 \
--method=POST \
--header="Content-Type: application/json" \
--header="test: test" \
--body-file="body.json" \
http://some.service/
  1. You should see 4xx errors (actually it's 405) for the endpoints that don't implement GET.
Done!
Statistics        Avg      Stdev        Max
  Reqs/sec        13.38     103.84    1081.03
  Latency      684.46ms   774.50ms      2.20s
  HTTP codes:
    1xx - 0, 2xx - 0, 3xx - 0, 4xx - 10, 5xx - 0
    others - 0
  Throughput:     3.53KB/s

What you expected to happen?

Should return 2xx response code.

What actually happened?

In this commit there was moved part where we set method before copying additional headers. So, if we add some headers to the request, method is overwritten and it's always set to GET (that's why we see 405 response code on the endpoint that won't handle it).
You can check this fork for resolving this mysterious issue :)

@makubit makubit changed the title Setting fastapi http method not working with additional headers set Setting fastapi http method not working with additional headers Jun 28, 2024
# 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

1 participant