Skip to content

Commit

Permalink
Removes eager initialization of the CompressionCodecResolver in the J…
Browse files Browse the repository at this point in the history
…wtParserBuilder

This removes a potential service loader issue with OSGi runtimes.

Fixes: #578
  • Loading branch information
bdemers committed Jul 13, 2020
1 parent dc120e8 commit 901048a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class DefaultJwtParserBuilder implements JwtParserBuilder {

private SigningKeyResolver signingKeyResolver;

private CompressionCodecResolver compressionCodecResolver = new DefaultCompressionCodecResolver();
private CompressionCodecResolver compressionCodecResolver;

private Decoder<String, byte[]> base64UrlDecoder = Decoders.BASE64URL;

Expand Down Expand Up @@ -191,6 +191,11 @@ public JwtParser build() {
this.deserializer = Services.loadFirst(Deserializer.class);
}

// if the compressionCodecResolver is not set default it.
if (this.compressionCodecResolver == null) {
this.compressionCodecResolver = new DefaultCompressionCodecResolver();
}

return new ImmutableJwtParser(
new DefaultJwtParser(signingKeyResolver,
key,
Expand Down

0 comments on commit 901048a

Please sign in to comment.