On Windows, browsers use a CR+LF line ending. JS doesn't count NL's as 2 bytes, but the server-side error check does. It looks like I have under 512 chars client-side, but the server errors because it counts LF's as chars.
Solution
On submit, server-side (and maybe client-side too) replace LF with null string.
Reproduction
Proposed Problem
On Windows, browsers use a CR+LF line ending. JS doesn't count NL's as 2 bytes, but the server-side error check does. It looks like I have under 512 chars client-side, but the server errors because it counts LF's as chars.
Solution
On submit, server-side (and maybe client-side too) replace LF with null string.