Add system properties to support allow non-serializable class (#9340)

This commit is contained in:
Albumen Kevin 2021-12-01 18:48:33 +08:00 committed by GitHub
parent 43d46d9d9e
commit 72c8cbae07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ public class DefaultHessian2FactoryInitializer extends AbstractHessian2FactoryIn
@Override
protected SerializerFactory createSerializerFactory() {
Hessian2SerializerFactory hessian2SerializerFactory = new Hessian2SerializerFactory();
hessian2SerializerFactory.getClassFactory().allow(RuntimeException.class.getName());
hessian2SerializerFactory.setAllowNonSerializable(Boolean.parseBoolean(System.getProperty("dubbo.hessian.allowNonSerializable", "false")));
hessian2SerializerFactory.getClassFactory().allow("org.apache.dubbo.*");
return hessian2SerializerFactory;
}

View File

@ -47,7 +47,7 @@ public class WhitelistHessian2FactoryInitializer extends AbstractHessian2Factory
}
}
}
serializerFactory.getClassFactory().allow(RuntimeException.class.getName());
serializerFactory.setAllowNonSerializable(Boolean.parseBoolean(System.getProperty("dubbo.hessian.allowNonSerializable", "false")));
serializerFactory.getClassFactory().allow("org.apache.dubbo.*");
return serializerFactory;
}