0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-12 11:29:36 +03:00

Fix: format flag not working (#410)

This commit is contained in:
秋のかえで
2021-03-21 17:13:51 +08:00
committed by GitHub
parent 4e63c22197
commit b0e7ad9663
2 changed files with 28 additions and 5 deletions

View File

@ -84,10 +84,19 @@ func LoadConfig(formatName string, input interface{}) (*Config, error) {
formats := make([]string, len(v))
hasProtobuf := false
for i, file := range v {
f := getFormat(file)
var f string
if formatName == "auto" {
f = getFormat(file)
if f == "" {
return nil, newError("Unable to get format of", formatName).AtWarning()
}
}
if f == "" {
f = formatName
}
if f == "protobuf" {
hasProtobuf = true
}