From fcc9d970748c74202d659d44879cf9e3b865933a Mon Sep 17 00:00:00 2001 From: Raymond Luo <34737002+RManLuo@users.noreply.github.com> Date: Thu, 11 Mar 2021 00:17:27 +0800 Subject: [PATCH] Do not cause error when `json:"fallback"` is `null` (#361) Co-authored-by: RPRX <63339210+rprx@users.noreply.github.com> --- infra/conf/trojan.go | 2 +- infra/conf/vless.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/infra/conf/trojan.go b/infra/conf/trojan.go index d243e33a..4fe96c07 100644 --- a/infra/conf/trojan.go +++ b/infra/conf/trojan.go @@ -104,7 +104,7 @@ type TrojanUserConfig struct { // TrojanServerConfig is Inbound configuration type TrojanServerConfig struct { Clients []*TrojanUserConfig `json:"clients"` - Fallback json.RawMessage `json:"fallback"` + Fallback *TrojanInboundFallback `json:"fallback"` Fallbacks []*TrojanInboundFallback `json:"fallbacks"` } diff --git a/infra/conf/vless.go b/infra/conf/vless.go index 91233703..f5ded7a0 100644 --- a/infra/conf/vless.go +++ b/infra/conf/vless.go @@ -29,7 +29,7 @@ type VLessInboundFallback struct { type VLessInboundConfig struct { Clients []json.RawMessage `json:"clients"` Decryption string `json:"decryption"` - Fallback json.RawMessage `json:"fallback"` + Fallback *VLessInboundFallback `json:"fallback"` Fallbacks []*VLessInboundFallback `json:"fallbacks"` }