Skip to content

Commit

Permalink
:artt: 修复xstream版本升级导致的权限问题
Browse files Browse the repository at this point in the history
  • Loading branch information
binarywang committed Apr 5, 2022
1 parent faeb342 commit cc04d8e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import com.google.common.collect.Maps;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.security.NoTypePermission;
import com.thoughtworks.xstream.security.WildcardTypePermission;
import org.joda.time.Interval;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -42,6 +44,8 @@ Emoji4Unicode read(boolean onlyFromLocal) {

XStream xstream = new XStream(new DomDriver());
xstream.processAnnotations(Emoji4Unicode.class);
xstream.addPermission(NoTypePermission.NONE);
xstream.addPermission(new WildcardTypePermission(new String[]{"com.github.binarywang.**"}));

if (onlyFromLocal) {
logger.info("==============from local file==============");
Expand Down

0 comments on commit cc04d8e

Please sign in to comment.