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

The "Header;" syntax for empty headers does not disable automatically generated headers #2357

Closed
mkauf opened this issue Mar 4, 2018 · 1 comment
Assignees
Labels

Comments

@mkauf
Copy link
Contributor

mkauf commented Mar 4, 2018

I did this

I want to disable an automatically generated header (e.g. "Host") and send an empty header instead:
/curl -v -H 'Host;' 'http://www.example.com'

I expected the following

I expected that curl sends a "Host" header with an empty value. Instead, it sends two "Host" headers, the default one ("Host: www.example.com") and the custom one ("Host:").

As a workaround, it's possible to send just the custom one with this command:
curl -v -H 'Host:' -H 'Host;' 'http://www.example.com'

curl/libcurl version

curl 7.59.0-DEV

operating system

Linux

@bagder bagder added the HTTP label Mar 4, 2018
@bagder
Copy link
Member

bagder commented Mar 4, 2018

Good find! This is clearly a mistake and we should fix it and add a test case or two for it...

@bagder bagder self-assigned this Mar 5, 2018
bagder added a commit that referenced this issue Mar 5, 2018
@bagder bagder closed this as completed in 8123560 Mar 11, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants