ok2c / httpcomponents-jackson

JSON message asynchronous producers and consumers for Apache HttpComponents 5.0 based on Jackson JSON library
https://ok2c.github.io/httpcomponents-jackson
Apache License 2.0
7 stars 6 forks source link

Fix assembling of simple valid non-object or non-array Json strings #16

Closed tveeders closed 1 month ago

tveeders commented 1 month ago

The idea is to also allow parsing of simple valid JSON strings which are not wrapped in an object or array. In the current implementation the Json sink is never invoked which leads to blocked resources (and timeouts) if the client does respond with just numbers, enum values etc.

By invoking the sink.accept function whenever a token was processed and the depth is 0 we also make sure simple JSON strings can be processed.

ok2c commented 1 month ago

@tveeders Good catch! Thank you for contributing the fix.