mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-29 06:31:56 +00:00
Recognize .jsonc files automatically (#2398)
Closes https://github.com/XTLS/Xray-core/issues/2399
This commit is contained in:
1 parent
ce89b5d7de
commit
017b56adf5
2 files changed
+3
-3
No files matched your search
+2
-2
@@ -113,13 +113,13 @@ func dirExists(file string) bool {
|
||||
func getRegepxByFormat() string {
|
||||
switch strings.ToLower(*format) {
|
||||
case "json":
|
||||
return `^.+\.json$`
|
||||
return `^.+\.(json|jsonc)$`
|
||||
case "toml":
|
||||
return `^.+\.toml$`
|
||||
case "yaml", "yml":
|
||||
return `^.+\.(yaml|yml)$`
|
||||
default:
|
||||
return `^.+\.(json|toml|yaml|yml)$`
|
||||
return `^.+\.(json|jsonc|toml|yaml|yml)$`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user