rakyll / hey

HTTP load generator, ApacheBench (ab) replacement
Apache License 2.0
17.63k stars 1.17k forks source link

Trim header name, if present, from flag -T value #242

Open ezeql opened 3 years ago

ezeql commented 3 years ago

Prevents content-type duplication. If the header name is present, it will be removed from the value provided in flag -T.

Currently an invocation like: hey -m POST -T 'Content-Type: application/json' -d '{"foo": "bar"}' http://localhost will make the header be set to 'Content-Type:Content-Type: application/json'

The introduced change fixes the user mistake by deduplicating "Content-Type" so the above example produces the intended request.

Hope this prevents unnecessary headaches for users :)