Skip to content

Commit

Permalink
Make sure we do not compare apples and oranges.
Browse files Browse the repository at this point in the history
The server time zone might no be UTC, so force all Time values to UTC for comparison purposes.
  • Loading branch information
jum committed Jan 14, 2025
1 parent a602314 commit 98ba48c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion certwatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func handleCert(ctx context.Context, cert string) (bool, error) {
return false, err
}
finfo, err := os.Stat(fname)
if err == nil && finfo.ModTime() == value.Modified && finfo.Size() == int64(len(value.Value)) {
if err == nil && finfo.ModTime().UTC() == value.Modified.UTC() && finfo.Size() == int64(len(value.Value)) {
continue
} else if err != nil && !errors.Is(err, fs.ErrNotExist) {
return false, err
Expand Down

0 comments on commit 98ba48c

Please sign in to comment.