diff --git a/pom.xml b/pom.xml index 82e4119..42a5416 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ com.alibaba fastjson - 1.2.76 + 2.0.7 diff --git a/src/main/java/cn/safe6/util/HttpTool.java b/src/main/java/cn/safe6/util/HttpTool.java index 2f4a9a0..ea9765b 100644 --- a/src/main/java/cn/safe6/util/HttpTool.java +++ b/src/main/java/cn/safe6/util/HttpTool.java @@ -573,6 +573,7 @@ public static boolean downloadFile(String downURL, String path) throws Exception public static Request parseRequest(String body) { Request request = new Request(); body = body.trim(); + body = body.replace("cookie","Cookie"); String[] parts = body.split("\r\n\r\n|\r\r|\n\n"); if (parts.length < 2) { return null; diff --git a/src/main/java/cn/safe6/util/PayloadEncryptTool.java b/src/main/java/cn/safe6/util/PayloadEncryptTool.java index 79096c9..5a1b40e 100644 --- a/src/main/java/cn/safe6/util/PayloadEncryptTool.java +++ b/src/main/java/cn/safe6/util/PayloadEncryptTool.java @@ -12,7 +12,7 @@ public class PayloadEncryptTool { public static String AesGcmEncrypt(byte[] plainText,String key) throws Exception{ - byte[] k = java.util.Base64.getDecoder().decode(key); + byte[] k = Base64.decode(key); AesCipherService aes = new AesCipherService(); ByteSource initciphertext = aes.encrypt(plainText, k); return String.valueOf(initciphertext); @@ -20,7 +20,7 @@ public static String AesGcmEncrypt(byte[] plainText,String key) throws Exception public static String AesCbcEncrypt(byte[] plainText,String key) throws Exception { - byte[] k = java.util.Base64.getDecoder().decode(key); + byte[] k = Base64.decode(key); byte[] ivBytes = new byte[16]; SecureRandom random = new SecureRandom(); random.nextBytes(ivBytes);