Pre Merge pull request !67 from liuyuxiang/N/A

This commit is contained in:
liuyuxiang 2025-04-14 08:11:01 +00:00 committed by Gitee
commit 1365b8d2e3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -14,6 +14,7 @@ import javax.servlet.http.HttpSession;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
@ -270,6 +271,13 @@ public class WebUtils {
*/
public static String decodeUrl(String source) {
String url = decodeBase64String(source, StandardCharsets.UTF_8);
try {
url = URLDecoder.decode(url, StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
if (! StringUtils.isNotBlank(url)){
return null;
}