Skip to content

Commit

Permalink
pass the MediaTypeProvider classloader to the SPI ServiceLoader
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
  • Loading branch information
nknize committed Jul 27, 2023
1 parent 963bc41 commit c69ec94
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public final class MediaTypeParserRegistry {
static {
List<MediaType> mediaTypes = new ArrayList<>();
Map<String, MediaType> amt = new HashMap<>();
for (MediaTypeProvider provider : ServiceLoader.load(MediaTypeProvider.class)) {
for (MediaTypeProvider provider : ServiceLoader.load(MediaTypeProvider.class, MediaTypeProvider.class.getClassLoader())) {
mediaTypes.addAll(provider.getMediaTypes());
amt = Stream.of(amt, provider.getAdditionalMediaTypes())
.flatMap(map -> map.entrySet().stream())
Expand Down

0 comments on commit c69ec94

Please sign in to comment.