Skip to content

Commit

Permalink
fix: int overflow for win in sse retryNoReconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Sep 8, 2023
1 parent 05ffb5e commit a26a4b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sse/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"strconv"

"github.com/anycable/anycable-go/common"
"github.com/anycable/anycable-go/encoders"
Expand Down Expand Up @@ -67,7 +68,7 @@ func (e *Encoder) Encode(msg encoders.EncodedMessage) (*ws.SentFrame, error) {
if msgType == "disconnect" {
dmsg, ok := msg.(*common.DisconnectMessage)
if ok && !dmsg.Reconnect {
payload += "\nretry: " + fmt.Sprintf("%d", retryNoReconnect)
payload += "\nretry: " + strconv.Itoa(retryNoReconnect)

Check failure on line 71 in sse/encoder.go

View workflow job for this annotation

GitHub Actions / upload_binaries

cannot use retryNoReconnect (untyped int constant 31536000000) as int value in argument to strconv.Itoa (overflows)
}
}

Expand Down

0 comments on commit a26a4b3

Please sign in to comment.