You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ curl -v --config test.curl
Warning: ./test.curl:2: warning: 'header' uses unquoted whitespace in the line
Warning: that may cause side-effects
* Trying 93.184.216.34:443...
* Connected to example.com (93.184.216.34) port 443
(...)
> POST / HTTP/1.1
> Host: example.com
> User-Agent: curl/8.4.0
> Accept: */*>
(...)
< HTTP/1.1 200 OK
I expected the following
Using the config file, I expected the exact same as the CLI output.
In particular, the Authorization header should be sent as described.
Note that changing the header line in the config file to:
header = 'Authorization: Bearer xxx'
Does not remove the curl warning, and still does not send that header.
By the way, I realise it should be better to just use oauth2-bearer instead of creating the header by hand, but I have the same issue with any other headers.
Not entirely sure why. I guess the warning message was using single quotes, and I didn't think well enough:
Warning: ./test.curl:2: warning: 'header' uses unquoted whitespace in the line
Perhaps the warning message could be extended a little bit with: "header" uses unquoted whitespace in the line. Consider quoting its value with double quotes. ?
When the config file parser detects a word that *probably* should be
quoted, mention double-quotes as a possible remedy.
Test 459 verifies.
Proposed-by: Jiehong on github
Fixes#12409
I did this
When using --config, and with the cli, I get different results.
Using the CLI
$ curl -v --request POST --header 'Authorization: Bearer xxxx' --url https://example.com
I get the following output:
Using a config file
With the following config file named
test.curl
:And then running it:
I expected the following
Using the config file, I expected the exact same as the CLI output.
In particular, the Authorization header should be sent as described.
Note that changing the header line in the config file to:
Does not remove the curl warning, and still does not send that header.
curl/libcurl version
curl 8.4.0 (aarch64-apple-darwin22.6.0) libcurl/8.4.0 (SecureTransport) OpenSSL/3.1.4 zlib/1.2.11 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.4 libssh2/1.11.0 nghttp2/1.58.0 librtmp/2.3 OpenLDAP/2.6.6
Release-Date: 2023-10-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
operating system
Darwin my-name 22.6.0 Darwin Kernel Version 22.6.0: Thu Nov 2 07:43:25 PDT 2023; root:xnu-8796.141.3.701.17~6/RELEASE_ARM64_T6020 arm64
The text was updated successfully, but these errors were encountered: