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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user