Skip to content

Commit

Permalink
处理配置文件 key 中包含 _ 的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzzh authored Oct 27, 2024
1 parent f47619f commit 83ec5be
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ else if (value instanceof List<?> list) {

private void mergeYaml(ConfigurationSection originalConfig, Map<String, Object> newMap) {
newMap.forEach((key, value) -> {
String originalKey = key.replace("_", "-");
final String originalKey = originalConfig.contains(key) ? key : key.replace("_", "-");
// 对象列表转为字符串列表
if (originalKey.equals("banned-peer-id") || originalKey.equals("banned-client-name")) {
if (value instanceof List<?> list) {
Expand Down

0 comments on commit 83ec5be

Please sign in to comment.