Allow whitelist to be loaded from fat jar files - #1465
Open
scottfrederick wants to merge 1 commit into
Open
scottfrederick wants to merge 1 commit into
scottfrederick wants to merge 1 commit into
Conversation
When a `META-INF/deserializable.types` file is located in a jar file nested inside another jar file (for example, a Spring Boot fat jar), it can be found as a resource but can't be read with `Files.readAllLines`. This commit changes the file reading to use an input stream that allows the file to be read in this scenario. Signed-off-by: Scott Frederick <scottyfred@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The commit 0c5d5f3 added support for a
META-INF/deserializable.typesfile that is read to determine the set of types that can be loaded byJsonMessageConverter. The file is read as a resource from the classpath.When the file is in a jar file that is nested within another jar file (for example, a Spring Boot fat jar), the
Files.readAllLines(Path.of(uri))used to read the file as a resource will fail, preventing the message conversion.This PR changes the file reading to use the streams API instead of the
FileAPI, which works when the file is in a flat jar or in a nested jar.