Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.7
-
None
-
Patch
Description
The method JsonSlurper.parse(Reader) throws the following exception:
groovy.json.JsonException: expecting '}' or ',' but got current char '' with an int value of 0 The current character read is '' with an int value of 0
if the reader does not always fill the complete char buffer at the method:
public int read(char[] cbuf, int off, int len) throws IOException
but returns a value < len on certain points.
I have provided a test case at
https://github.com/effrafax/jsonslurp
A standard use case where this exception occurs:
if you use a http-builder with JSON contentType where the server returns the response chunked (Transfer-Encoding: chunked). The InputStreamReader of the apache http client does not fill the complete char buffer at chunk borders.
Attachments
Attachments
Issue Links
- is duplicated by
-
GROOVY-7028 Chunked input stream incorrectly handled in IO.read()
- Closed