Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeTraversingParser does not take base64 variant into account #2096

Closed
tangiel opened this issue Jul 26, 2018 · 2 comments
Closed

TreeTraversingParser does not take base64 variant into account #2096

tangiel opened this issue Jul 26, 2018 · 2 comments

Comments

@tangiel
Copy link

tangiel commented Jul 26, 2018

This affects at least 2.6.4 to current versions. In TreeTraversingParser#getBinaryValue, a Base64Variant is accepted but ignored. The call to n.binaryValue(), when n is a TextNode, then uses the default Base64 variant instead of what's specified. It seems the correct behavior would be to call TextNode#getBinaryValue instead.

@cowtowncoder
Copy link
Member

Sounds like a flaw indeed. Just need to see how/where to access base64 variant.

@tangiel
Copy link
Author

tangiel commented Jul 26, 2018

If you change the assignment of byte[] data to:

            byte[] data = n.isTextual()
                    ? ((TextNode) n).getBinaryValue(b64variant)
                    : n.binaryValue();

That seems sufficient, though I am operating on 2.6 and it looks like ObjectMapper has undergone a lot of refactoring since then. Presumably it would propagate the variant down correctly to the method.

@cowtowncoder cowtowncoder changed the title TreeTraversingParser does not take base64 variant into account TreeTraversingParser does not take base64 variant into account Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants