Skip to content

Setting fastapi http method not working with additional headers #110

Description

@makubit

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 :)

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions