Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending a header with an empty value #706

Open
gonubana opened this issue Nov 29, 2022 · 0 comments · May be fixed by typhoeus/ethon#225
Open

Sending a header with an empty value #706

gonubana opened this issue Nov 29, 2022 · 0 comments · May be fixed by typhoeus/ethon#225

Comments

@gonubana
Copy link

Hello!

I am trying to make a head request with 2 custom headers, one of them having an empty value:

Typhoeus.head('https://example.com', headers: {'h_k1' => '', 'h_k2' => 'h_v2'}, verbose: true)

but when I inspect what headers get sent (by libcurl), the header with an empty value (h_k1) isn't among them.

Put simply, I'd like to reproduce:

curl -v -I -H 'h_k1;' -H 'h_k2: h_v2' https://example.com

with typhoeus.

gonubana pushed a commit to gonubana/ethon that referenced this issue Dec 1, 2022
while also allowing the user to remove default headers set by libcurl.
See https://curl.se/libcurl/c/CURLOPT_HTTPHEADER.html for more details.

passing " headers: {'h1' => 'v1', 'h2' => '', 'h3;' => ''} "
corresponds to these curl options: " -H 'h1: v1' -H 'h2:'  -H 'h3;' "

Enhances typhoeus#132
Fixes typhoeus/typhoeus#706
@gonubana gonubana linked a pull request Dec 1, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant