You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
ConfigQueryRequestHandler.readFileContent miss line char.
读配置丢失换行符
Expected behavior
Restore the original configuration content.
还原为原本的配置,直接 read 字节后转成字符串为最佳?
Acutally behavior
The newline character is lost, and the configuration content is inconsistent with the server after it is returned to the client MD5.
丢失换行符,配置内容返回客户端 md5 后与服务端不一致。
Additional context
That's what I'm dealing with right now.
暂时如此处理,但内容该是返璞归真。
publicstaticStringreadFileContent(Filefile) {
StringBuildersb = newStringBuilder();
try (BufferedReaderreader = newBufferedReader(newFileReader(file))) {
StringtempStr;
while ((tempStr = reader.readLine()) != null) {
// FIXME readLine lose '\n', It may not be restored because the content is inconsistent. The MD5 value of the client is different from that of the serversb.append(tempStr).append('\n');
}
sb.setLength(sb.length() - 1);
returnsb.toString();
} catch (IOExceptione) {
e.printStackTrace();
}
returnsb.toString();
}
The text was updated successfully, but these errors were encountered:
CherishCai
changed the title
ConfigQueryRequestHandler.readFileContent miss line char. 读配置丢失换行符
2.0.0-ALPHA.1 ConfigQueryRequestHandler.readFileContent miss line char. 读配置丢失换行符
Jan 13, 2021
Describe the bug
ConfigQueryRequestHandler.readFileContent miss line char.
读配置丢失换行符
Expected behavior
Restore the original configuration content.
还原为原本的配置,直接 read 字节后转成字符串为最佳?
Acutally behavior
The newline character is lost, and the configuration content is inconsistent with the server after it is returned to the client MD5.
丢失换行符,配置内容返回客户端 md5 后与服务端不一致。
Additional context
That's what I'm dealing with right now.
暂时如此处理,但内容该是返璞归真。
publicstaticStringreadFileContent(Filefile) {
StringBuildersb = newStringBuilder();
try (BufferedReaderreader = newBufferedReader(newFileReader(file))) {
StringtempStr;
while ((tempStr = reader.readLine()) != null) {
// FIXME readLine lose '\n', It may not be restored because the content is inconsistent. The MD5 value of the client is different from that of the serversb.append(tempStr).append('\n');
}
sb.setLength(sb.length() - 1);
returnsb.toString();
} catch (IOExceptione) {
e.printStackTrace();
}
returnsb.toString();
}
OK,I have reproduce this bug local ,thank you very much to report this bug.
Describe the bug
ConfigQueryRequestHandler.readFileContent miss line char.
读配置丢失换行符
Expected behavior
Restore the original configuration content.
还原为原本的配置,直接 read 字节后转成字符串为最佳?
Acutally behavior
The newline character is lost, and the configuration content is inconsistent with the server after it is returned to the client MD5.
丢失换行符,配置内容返回客户端 md5 后与服务端不一致。
Additional context
That's what I'm dealing with right now.
暂时如此处理,但内容该是返璞归真。
config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigQueryRequestHandler.java
The text was updated successfully, but these errors were encountered: