openvidu-server: normalize DOTENV_PATH

pull/494/head
pabloFuente 2020-05-19 13:25:56 +02:00
parent f17db7645b
commit 5c9e18c7ba
1 changed files with 4 additions and 2 deletions

View File

@ -37,6 +37,7 @@ import java.util.Map;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import org.apache.commons.io.FilenameUtils;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicHeader;
import org.kurento.jsonrpc.JsonUtils; import org.kurento.jsonrpc.JsonUtils;
@ -916,12 +917,13 @@ public class OpenviduConfig {
if (getDotenvPath() != null && !getDotenvPath().isEmpty()) { if (getDotenvPath() != null && !getDotenvPath().isEmpty()) {
Path path = getDotenvFilePathFromDotenvPath(getDotenvPath()); Path path = getDotenvFilePathFromDotenvPath(getDotenvPath());
File file = path.toFile(); String normalizePath = FilenameUtils.normalize(path.toAbsolutePath().toString());
File file = new File(normalizePath);
if (file.exists()) { if (file.exists()) {
return file; return file;
} else { } else {
log.error(".env file not found at {}", path.toAbsolutePath().toString()); log.error(".env file not found at {}", file.getAbsolutePath().toString());
} }
} else { } else {