envoyproxy / envoyproxy/nighthawk
request_body_size is dropped from CommandLineOptions when no request header is configured
- Dominant language
- C++
- Stars
- 414
- Forks
- 95
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 11
Description
*Title*: request_body_size is dropped from CommandLineOptions when no request header is configured
*Description*:
`OptionsImpl::toCommandLineOptions()` sets `request_options.request_body_size` inside the loop over the configured request headers, so with `--request-body-size N` but no `--request-header` the size is not emitted into the `CommandLineOptions` proto. Executions routed through the gRPC service (`--nighthawk-service`) therefore run with an empty body. It should always be emitted.
*Reproduction steps*:
```
nighthawk_client --request-body-size 1234 --nighthawk-service http://target/
```
Compare the executed request body size (0) with a run that also passes any `--request-header`.
*Logs*:
No error is logged; the proto simply lacks the field.
*Call Stack*:
Not a crash.
Contributor guide
Research direction
Start with OptionsImpl::toCommandLineOptions(), where request_options.request_body_size is assigned inside the configured request-header loop. Reproduce with --request-body-size 1234 and --nighthawk-service without --request-header, then verify that the CommandLineOptions proto carries the size and the executed request is no longer empty.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100