Closed simmel closed 7 years ago
I can reproduce this, but it seems to be a browser feature:
https://tools.ietf.org/html/rfc1867
As with all MIME transmissions, CRLF is used as the separator for lines in a POST of the data in multipart/form-data.
https://tools.ietf.org/html/rfc2388 https://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2 https://stackoverflow.com/questions/6963480/firefox-and-chrome-replacing-lf-with-crlf-during-post
This can't be fixed by pb, because the data is mangled by the client/browser before being sent, and pb only faithfully stores the paste byte-for-byte with no other interpretation or transformation.
This is actually a proper standard specific to HTML forms, so not even a bug either:
https://www.w3.org/TR/html5/forms.html#the-textarea-element
The element's value is defined to be the element's raw value with the following transformation applied:
Replace every occurrence of a "CR" (U+000D) character not followed by a "LF" (U+000A) character, and every occurrence of a "LF" (U+000A) character not preceded by a "CR" (U+000D) character, by a two-character string consisting of a U+000D CARRIAGE RETURN "CRLF" (U+000A) character pair.
In fact, if anything, curl's behavior is arguably not correct by not applying this transformation to form fields.
Heyo!
When using the form to paste anything (I've tried selecting in Firefox, Terminal) and pasting that makes the paste a "DOS" document, i.e. it has CRLF line endings.
Example:b
0x0d
is CR and0x0a
is LF, see http://www.asciitable.com/Note that when pasting via
curl
it does NOT create CRLF ended lines but LF.