-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
--verbose
prints CR+LF (\r\n
) instead of just \n
for header lines (started with >
or <
) on Linux
#16285
Comments
I believe curl has done this since its first release. |
I fear that changing this now will cause problems to users who through the decades have adapted to this behavior. The output is quite simply exactly what the server sends, and as curl also supports plain LR line endings for HTTP/1 transfers they are not always stored as CRLF. I think we should consider documenting this properly to be the fix. |
Fixes #16285 Reported-by: Andrei Korshikov
I think so too:)
Hmm. The problem is: there is no CR or LF or CRLF on the wire (I've checked with Wireshark), but So, I believe #99903b5 is very confusing and even misleading. While it is technically true ( Maybe my original description was not clear enough, I'm sorry if so. |
If you ask for HTTP/1.1, you do. When curl speaks HTTP/2 or HTTP/3 it converts and shows the headers to look the same: then the CRLF pair is actually put there by curl itself. But the purpose is then to make them look like they do when HTTP/1.x is used. I'm not sure we need to elaborate on this exact process in the documentation.
Like for received that's because the protocol includes CRLF. |
Aha! Now I see. Thank you for the explanation. And, of course, thank you for curl:) |
I did this
$ curl 'https://curl.se' --head --verbose 2>output
Look in
output
at lines started with<
or>
(headers-related): they have^M
at the end, i.e. they ends with 0x0D0A.Other lines (started with
*
,{
or}
) are not affected (don't contain\r
before\n
).I expected the following
All
--verbose
output lines should end with\n
—not\r\n
—on Linux.curl/libcurl version
curl 8.12.0 (x86_64-pc-linux-gnu) libcurl/8.12.0 OpenSSL/3.4.0 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.64.0 nghttp3/1.7.0
Release-Date: 2025-02-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
operating system
Linux laptop 6.7.8-zen1-1-zen
#1
ZEN SMP PREEMPT_DYNAMIC Sun, 03 Mar 2024 00:30:23 +0000 x86_64 GNU/Linux(Arch Linux)
The text was updated successfully, but these errors were encountered: