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:
parent
7c05adee7b
commit
22e42ddb80