paramhlp: fix CRLF-stripping files with "-d @file"

All CR and LF bytes should be stripped, as documented, and all other
bytes are inluded in the data. Starting now, it also excludes null bytes
as they would otherwise also cut the data short.

Reported-by: Simon K
Fixes #13063
Closes #13064
This commit is contained in:
Daniel Stenberg 2024-03-06 15:39:09 +01:00
parent ed97fe06ac
commit 923f7f8ce5
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 52 additions and 13 deletions

View file

@ -40,8 +40,8 @@ data pieces specified are merged with a separating &-symbol. Thus, using
If you start the data with the letter @, the rest should be a filename to read
the data from, or - if you want curl to read the data from stdin. Posting data
from a file named 'foobar' would thus be done with --data @foobar. When --data
is told to read from a file like that, carriage returns and newlines are
stripped out. If you do not want the @ character to have a special
is told to read from a file like that, carriage returns, newlines and null
bytes are stripped out. If you do not want the @ character to have a special
interpretation use --data-raw instead.
The data for this option is passed on to the server exactly as provided on the