Make type check strict

This commit is contained in:
世界 2023-12-05 19:09:13 +08:00
parent 09421b6378
commit 744a5d703b
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
4 changed files with 9 additions and 3 deletions

View file

@ -111,6 +111,8 @@ func (h *Inbound) UnmarshalJSON(bytes []byte) error {
v = &h.TUICOptions
case C.TypeHysteria2:
v = &h.Hysteria2Options
case "":
return E.New("missing inbound type")
default:
return E.New("unknown inbound type: ", h.Type)
}