-
-
Notifications
You must be signed in to change notification setting 8000 s - Fork 6.7k
curl duplicates Sec-WebSocket-* headers on ws scheme urls #17170
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
Comments
It is of course a little like asking for trouble to provide that extensive set, but sure it should certainly make a best-effort. The |
Same problem without
|
It passed in the wrong header length to the check function, which made it do duplicated headers in cases where the user provides its own set. Reported-by: sbernatsky on github Fixes #17170
I did this
curl command generates its own
Connection
,Sec-WebSocket-Version
, andSec-WebSocket-Key
headers for ws scheme urls even if they are provided via-H
parameter:This results in 400 Bad Request response.
However for http scheme those headers are not generated and 101 response is returned back:
I expected the following
I expect that regardless of the url scheme used the headers won't be duplicated in request if they are provided in extra parameters.
curl/libcurl version
curl 8.13.0 (x86_64-apple-darwin) libcurl/8.13.0 OpenSSL/3.4.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.7 c-ares/1.34.4 libidn2/2.3.8 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.65.0 nghttp3/1.8.0
Release-Date: 2025-04-02
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Largefile libz NTLM PSL SSL SSLS-EXPORT threadsafe TLS-SRP TrackMemory UnixSockets zstd
operating system
MacOS
The text was updated successfully, but these errors were encountered: