mirror of https://github.com/jwtk/jjwt.git
Issue-52: Refactoring and adding unit tests to cover the compression functionality
This commit is contained in:
parent
806844a89a
commit
7e15e2de02
|
@ -48,7 +48,7 @@ public class DefaultCompressionCodecResolver implements CompressionCodecResolver
|
|||
throw new CompressionException("Unsupported compression algorithm '" + cmpAlg + "'");
|
||||
}
|
||||
|
||||
protected final String getAlgorithmFromHeader(Header header) {
|
||||
private String getAlgorithmFromHeader(Header header) {
|
||||
Assert.notNull(header, "header cannot be null.");
|
||||
|
||||
return header.getCompressionAlgorithm();
|
||||
|
|
|
@ -415,7 +415,7 @@ class JwtsTest {
|
|||
def jws = Jwts.parser().setSigningKey(key).setCompressionCodecResolver(new DefaultCompressionCodecResolver() {
|
||||
@Override
|
||||
CompressionCodec resolveCompressionCodec(Header header) {
|
||||
String algorithm = getAlgorithmFromHeader(header);
|
||||
String algorithm = header.getCompressionAlgorithm()
|
||||
if ("CUSTOM".equals(algorithm)) {
|
||||
return CompressionCodecs.GZIP
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue