forked from erlang/otp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`json:decode/3` always stripped leading whitespaces in the `Rest` binary, which could be problematic if user expected them. E.g `json:decode(<<"foo\n bar">>, ok, #{})` returned: `{<<"foo">>, ok, <<"bar">>}` instead of `{<<"foo">>, ok, <<"\n bar">>}`. If `Rest` only contains whitespaces they are removed, so that the user can match on empty binary to know if they should continue the decoding loop. E.g `json:decode(<<"foo\n ">>, ok, #{})` still returns: `{<<"foo">>, ok, <<>>}`
- Loading branch information
Showing
2 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters