Skip to content

Commit

Permalink
fix: truncate requests header timestamp instead of rounding
Browse files Browse the repository at this point in the history
This avoids having 50% of timestamps being in the future, which is
rejected by some servers like PyKMIP

Signed-off-by: Pierre-Henri Symoneaux <[email protected]>
  • Loading branch information
phsym committed Mar 6, 2025
1 parent 2e4a0c5 commit ecb8034
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type RequestMessage struct {
}

func NewRequestMessage(version ProtocolVersion, payloads ...OperationPayload) RequestMessage {
timestamp := time.Now().Round(time.Second)
timestamp := time.Now().Truncate(time.Second)
msg := RequestMessage{
Header: RequestHeader{
ProtocolVersion: version,
Expand Down

0 comments on commit ecb8034

Please sign in to comment.