Skip to content

Commit

Permalink
Omit reject.method=default
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Feb 20, 2025
1 parent f07f505 commit 5d27487
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions option/rule_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,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 {
Expand Down

0 comments on commit 5d27487

Please sign in to comment.