mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-08 01:22:07 +08:00
option: Fix omitempty reject method
This commit is contained in:
parent
3dbe90c535
commit
6103ecb771
@ -252,6 +252,14 @@ type _RejectActionOptions struct {
|
||||
|
||||
type RejectActionOptions _RejectActionOptions
|
||||
|
||||
func (r RejectActionOptions) MarshalJSON() ([]byte, error) {
|
||||
switch r.Method {
|
||||
case C.RuleActionRejectMethodDefault:
|
||||
r.Method = ""
|
||||
}
|
||||
return json.Marshal((_RejectActionOptions)(r))
|
||||
}
|
||||
|
||||
func (r *RejectActionOptions) UnmarshalJSON(bytes []byte) error {
|
||||
err := json.Unmarshal(bytes, (*_RejectActionOptions)(r))
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user