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

Closed
mkauf opened this Issue Mar 4, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@mkauf
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

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Mar 4, 2018

Owner

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

Owner

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 in 8123560 Mar 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment