Skip to content

wcurl: document how --curl-options splits its value - #103

Merged
samueloph merged 1 commit into
mainfrom
samueloph/doc-curl-options-splitting
Sep 27, 2026
Merged

samueloph merged 1 commit into
mainfrom
samueloph/doc-curl-options-splitting

Conversation

@samueloph

Copy link
Copy Markdown
Collaborator

The value of --curl-options is split on whitespace into separate curl arguments, and quotes and backslashes are not interpreted, but the documentation never said so. Someone passing a header whose value contains spaces, e.g.:

wcurl --curl-options='-H "Cookie: a=1; b=2"' example.com

ends up with curl receiving '-H', '"Cookie:', 'a=1;' and 'b=2"', and treating the extra words as URLs to download.

Spell out the splitting rule, point to curl's '--config' or to using curl directly for arguments containing whitespace, and warn against building the value from untrusted input.

Thanks to Harry Sintonen for reporting the issue.

The value of --curl-options is split on whitespace into separate curl
arguments, and quotes and backslashes are not interpreted, but the
documentation never said so. Someone passing a header whose value
contains spaces, e.g.:

  wcurl --curl-options='-H "Cookie: a=1; b=2"' example.com

ends up with curl receiving '-H', '"Cookie:', 'a=1;' and 'b=2"', and
treating the extra words as URLs to download.

Spell out the splitting rule, point to curl's '--config' or to using
curl directly for arguments containing whitespace, and warn against
building the value from untrusted input.

Thanks to Harry Sintonen for reporting the issue.
@samueloph
samueloph merged commit 47fab4e into main Sep 27, 2026
4 checks passed
@samueloph
samueloph deleted the samueloph/doc-curl-options-splitting branch September 27, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant