redpanda-data / redpanda-data/benthos

"http_server" input: query parameter overwrites header field with the same name

Open
#136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement http metadata
Dominant language
Go
Stars
571
Forks
120
Avg merge
2d 1h
Merged PRs (30d)
18

Description

When using the http_server input, the query parameters and header fields are both kept in the metadata. This has the consequence that if a query parameter has the name as a header field, the header field value gets overwritten with the query parameter. This likely hasn't been reported due to the odd chances of query parameters and header field names coinciding (also due to differing capitalization traditions).

As @mihaitodor suggested on Discord, where I asked about this behavior, that extra parameters could be introduced to configure different namespaces (i.e. sub-objects of meta) for query parameters and header fields.

I like this idea as it would also enable to test for request errors 414 (Request URI too long) and 431 (header fields too large) correctly, which is currently not possible.

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.

Research direction

Start at the http_server input's metadata construction and trace how query parameters and header fields are inserted. Define separate metadata namespaces for the two sources, then add coverage for same-name collisions and the 414/431 cases described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.