cheryy-pick [Fix-8913][Worker]fix roll view log null exception #8914 (#8918)

This commit is contained in:
Kerwin 2022-03-16 10:05:23 +08:00 committed by GitHub
parent 9717da6c25
commit e2b962e775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -142,6 +142,9 @@ public class LoggerRequestProcessor implements NettyRequestProcessor {
private boolean checkPathSecurity(String path) {
String dsHome = System.getProperty("DOLPHINSCHEDULER_HOME");
if (StringUtils.isBlank(dsHome)) {
dsHome = System.getProperty("user.dir");
}
if (!StringUtils.isBlank(path)) {
if (path.startsWith(dsHome) && !path.contains("../") && path.endsWith(".log")) {
return true;