diff options
author | 2024-01-15 14:08:07 +0100 | |
---|---|---|
committer | 2024-01-15 14:08:07 +0100 | |
commit | 6433a505820cfeb43990a3453a0ed8b24e432b7d (patch) | |
tree | 3f968a63d6a77991df95fde88ee0f08727f26eb6 /vendor/github.com/vmihailenco/msgpack/v5/time.go | |
parent | [chore]: Bump github.com/tdewolff/minify/v2 from 2.20.12 to 2.20.14 (#2530) (diff) | |
download | gotosocial-6433a505820cfeb43990a3453a0ed8b24e432b7d.tar.xz |
[chore] update bun + extras v1.1.16 -> v1.1.17 (#2534)
Diffstat (limited to 'vendor/github.com/vmihailenco/msgpack/v5/time.go')
-rw-r--r-- | vendor/github.com/vmihailenco/msgpack/v5/time.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vendor/github.com/vmihailenco/msgpack/v5/time.go b/vendor/github.com/vmihailenco/msgpack/v5/time.go index 44566ec07..1a4ba1265 100644 --- a/vendor/github.com/vmihailenco/msgpack/v5/time.go +++ b/vendor/github.com/vmihailenco/msgpack/v5/time.go @@ -26,6 +26,11 @@ func timeDecoder(d *Decoder, v reflect.Value, extLen int) error { return err } + if tm.IsZero() { + // Zero time does not have timezone information. + tm = tm.UTC() + } + ptr := v.Addr().Interface().(*time.Time) *ptr = tm @@ -103,7 +108,8 @@ func (d *Decoder) DecodeTime() (time.Time, error) { return time.Time{}, err } - if extID != timeExtID { + // NodeJS seems to use extID 13. + if extID != timeExtID && extID != 13 { return time.Time{}, fmt.Errorf("msgpack: invalid time ext id=%d", extID) } |