Skip to content

curl and libcurl 8.16.0 silently drop second 'Connection: ' header in HTTP/1.x modes #18662

@Karlson2k

Description

@Karlson2k

I did this

$ curl --http1.1 -H 'Connection: abc' -H 'Connection: xyz' -v -o /dev/null http://curl.se
[...skip...]
* Established connection to curl.se (151.101.65.91 port 80) from x.x.x.x port XXXXX
* using HTTP/1.x
> GET / HTTP/1.1
> Host: curl.se
> User-Agent: curl/8.16.0
> Accept: */*
> Connection: abc
>
* Request completely sent off
[...skip...]

I expected the following

This is an actual output of curl 8.15.0

$ curl --http1.1 -H 'Connection: abc' -H 'Connection: xyz' -v -o /dev/null http://curl.se
[...skip...]
* Connected to curl.se (151.101.1.91) port 80
* using HTTP/1.x
> GET / HTTP/1.1
> Host: curl.se
> User-Agent: curl/8.15.0
> Accept: */*
> Connection: abc
> Connection: xyz
>
* Request completely sent off
[...skip...]

curl/libcurl version

curl 8.16.0 (x86_64-pc-linux-gnu) libcurl/8.16.0 OpenSSL/3.4.2 zlib/1.3.1 brotli/1.1.0 zstd/1.5.7 c-ares/1.34.5 libidn2/2.3.8 libpsl/0.21.5 nghttp2/1.65.0 nghttp3/1.9.0
Release-Date: 2025-09-10
Protocols: dict file ftp ftps http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp smtp smtps tftp ws wss
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTP3 HTTPS-proxy HTTPSRR IDN IPv6 Largefile libz NTLM PSL SSL threadsafe TLS-SRP UnixSockets zstd

operating system

Linux somename 6.16.8-gentoo-k2k-optim71 SMP PREEMPT Sat Sep 20 15:27:55 CEST 2025 x86_64 AMD Ryzen * **** Processor AuthenticAMD GNU/Linux

additional information

Other headers work fine:

$ curl --http1.1 -H 'Connection1: abc' -H 'Connection1: xyz' -v -o /dev/null http://curl.se
[...skip...]
* Established connection to curl.se (151.101.129.91 port 80) from x.x.x.x port XXXXX
* using HTTP/1.x
> GET / HTTP/1.1
> Host: curl.se
> User-Agent: curl/8.16.0
> Accept: */*
> Connection1: abc
> Connection1: xyz
>
* Request completely sent off
[...skip...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions