File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed
Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -167,21 +167,9 @@ class ParsingBoundaryFinder : public BoundaryFinder {
167167
168168 while (consumed_length < block_length) {
169169 auto length = ConsumeWholeObject (block);
170- if (length == string_view::npos) {
171- const size_t start = ConsumeWhitespace (block);
172- if (start < block.size () && block[start] != ' {' && block[start] != ' [' ) {
173- return Status::Invalid (" JSON parse error: Invalid value" );
174- }
175- // found incomplete object
176- break ;
177- }
178- if (length == 0 ) {
179- // Check if remaining block contains invalid content (not starting with { or [)
180- const size_t start = ConsumeWhitespace (block);
181- if (start < block.size () && block[start] != ' {' && block[start] != ' [' ) {
182- return Status::Invalid (" JSON parse error: Invalid value" );
183- }
184- // found incomplete object or block is empty
170+ if (length == string_view::npos || length == 0 ) {
171+ // Incomplete or invalid document - stop here.
172+ // The remaining content is left as "partial" for later error handling.
185173 break ;
186174 }
187175 consumed_length += length;
You can’t perform that action at this time.
0 commit comments