mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-29 13:22:06 +03:00
option: Fix omitempty reject method
This commit is contained in:
@@ -252,6 +252,14 @@ type _RejectActionOptions struct {
|
|||||||
|
|
||||||
type RejectActionOptions _RejectActionOptions
|
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 {
|
func (r *RejectActionOptions) UnmarshalJSON(bytes []byte) error {
|
||||||
err := json.Unmarshal(bytes, (*_RejectActionOptions)(r))
|
err := json.Unmarshal(bytes, (*_RejectActionOptions)(r))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user