mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 01:08:33 +00:00
Fix: format flag not working (#410)
This commit is contained in:
parent
4e63c22197
commit
b0e7ad9663
2 changed files with 28 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue