request_body_size is dropped from CommandLineOptions when no request header is configured

Open Beginner friendly
#1,606 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
cli

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.

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 <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.

Dominant language
C++
Stars
415
Forks
95
Avg merge
2d 9h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from envoyproxy/nighthawk

All issues in envoyproxy/nighthawk

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.