Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Weight input as integer
Browse files Browse the repository at this point in the history
  • Loading branch information
hurracrane committed Nov 19, 2021
1 parent 1afc2e8 commit be1b76e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ func (c *client) makeEmailRequest(ctx context.Context, e *Email) *resty.Request
if e.options.flag != 0 {
headers["Flag"] = fmt.Sprintf("%d", e.options.flag)
}
if e.options.weight != 0.0 {
headers["Weight"] = fmt.Sprintf("%f", e.options.weight)
if e.options.weight != 0 {
headers["Weight"] = fmt.Sprintf("%d", e.options.weight)
}
return c.client.R().
SetContext(ctx).
Expand Down
4 changes: 2 additions & 2 deletions email.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Email struct {
// Options encapsulate headers the client can pass in requests to rspamd.
type Options struct {
flag int
weight float64
weight int32
}

// SymbolData encapsulates the data returned for each symbol from Check.
Expand Down Expand Up @@ -58,7 +58,7 @@ func (e *Email) Flag(flag int) *Email {

// Weight attaches a weight to an Email, and eventually as a header when sent to rspamd.
// Weight is added to hashes.
func (e *Email) Weight(weight float64) *Email {
func (e *Email) Weight(weight int32) *Email {
e.options.weight = weight
return e
}
Expand Down

0 comments on commit be1b76e

Please sign in to comment.