Skip to content

Curl 8.6.0+ doesn't allow empty string in args #13966

@matthewhughes934

Description

@matthewhughes934

I did this

$ curl "" --silent www.example.com

And I saw an error:

curl: option : blank argument where content is expected
curl: try 'curl --help' for more information

I expected the following

Curl to run as if I had passed it curl --silent www.example.com based on #13144 (I think it was also introduced with 07bcae8), though similar to there I'm not sure if this is a bug or intentional behaviour but thought I'd post all the same for visibility, given there is a behaviour change.

building at 07bcae89d5d0090f1d11866d5f9c98c3720a2838~ (i.e. f59223f) and I see the following behaviour:

$ ./src/curl "" www.example.com >/dev/null
curl: (3) URL rejected: Malformed input to a URL function
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1256  100  1256    0     0   7399      0 --:--:-- --:--:-- --:--:--  7431
$ ./src/curl "" --silent www.example.com >/dev/null

I.e. the request to www.example.com is made in both cases and the --silent option is used in the second.

I noticed this behaviour as a result of karancode/kustomize-github-action#46. The root cause of that is the curl invocation https://github.com/karancode/kustomize-github-action/blob/883a86ec3535e4e7d0fe6450a85f8325c97d2a7b/src/entrypoint.sh#L54 where ${with_token[@]}" being empty it will result in a "" in the args.

curl/libcurl version

$ curl --version
curl 8.8.0 (x86_64-pc-linux-gnu) libcurl/8.8.0 OpenSSL/3.3.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.62.1 nghttp3/1.3.0
Release-Date: 2024-05-22
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
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

Tested with the same result at current master (0473905)

operating system

Arch Linux 6.6.32-1-lts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions