Skip to content

--verbose prints CR+LF (\r\n) instead of just \n for header lines (started with > or <) on Linux #16285

@andrei-korshikov

Description

@andrei-korshikov

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions