dschmidt opened a new pull request, #3098: URL: https://github.com/apache/tika/pull/3098
`ParseRecord.depth` is incremented for every composite parser a parse passes through. With `AutoDetectParser` wrapping `DefaultParser` that is two per document level, and the depth check compared that counter with `maxDepth + 1`, so `maxDepth=2` parsed depth 1 only, `maxDepth=3` reached depth 2, and so on. `maxDepth=0` and `1` happened to work, which is what the existing tests cover. `ParseRecord` now has an embedding depth that `ParsingEmbeddedDocumentExtractor` and `UnpackExtractor` raise around the child's parse, and the limit is checked against that: with `maxDepth=N`, documents at depth N are parsed and their children are not, as the `EmbeddedLimits` javadoc describes. The composite counter stays as it is for its other uses (top-level detection, handler decoration). The new test nests a parser five levels deep behind two composite layers and fails on main for maxDepth 2, 3 and 5. https://issues.apache.org/jira/browse/TIKA-4857 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
