improve validations for user provided file and directory paths

This commit is contained in:
Nicola Murino
2020-03-03 09:09:58 +01:00
parent d0a81cabab
commit 7f1946de34
13 changed files with 72 additions and 10 deletions

View File

@@ -149,7 +149,7 @@ func getCustomServeFlags() []string {
result = append(result, "--"+configFileFlag)
result = append(result, configFile)
}
if logFilePath != defaultLogFile && len(logFilePath) > 0 && logFilePath != "." {
if logFilePath != defaultLogFile && utils.IsFileInputValid(logFilePath) {
if !filepath.IsAbs(logFilePath) {
logFilePath = filepath.Join(configDir, logFilePath)
}