fix: do not modify incoming event's specversion (#419)

Even if the specversion is totally invalid, we should not change the value
received in an incoming `Message`. Previously we defaulted to 1.0 if we did
not recognize the version number. This commit changes that, leaving the value
unmodified. We default to parsing this mystery event with the 1.0 spec. When
the event is validated with `event.validate()` we return `false`.

One additional small change to eliminate a prettier warning about `parer`
being previously declared.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/332
Fixes: https://github.com/cloudevents/sdk-javascript/issues/333

Signed-off-by: Lance Ball <lball@redhat.com>
This commit is contained in:
Lance Ball 2021-05-25 11:10:46 -04:00 committed by GitHub
parent 7c05adee7b
commit 22e42ddb80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

Diff Content Not Available