diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..04f9c23 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) + +## [0.3.1] + +### Fixed + +- Axios version to `0.18.1` due the CVE-2019-10742 +- Fix the `subject` attribute unmarshal error: issue +[#32](https://github.com/cloudevents/sdk-javascript/issues/32) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a992b73..f9a7a41 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,11 @@ ahead of `master`. - [Gitflow](https://nvie.com/posts/a-successful-git-branching-model/) by @nvie +## Changelog + +Always update the [CHANGELOG.md](./CHANGELOG.md), following +[this semantics](https://keepachangelog.com/en/1.0.0/). + ## Pull Requests Guidelines about how to perform pull requests. diff --git a/README.md b/README.md index 0d0f420..a5450cd 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![downloads](https://img.shields.io/npm/dy/cloudevents-sdk.svg)](https://www.npmjs.com/package/cloudevents-sdk) [![npm version](https://img.shields.io/npm/v/cloudevents-sdk.svg)](https://www.npmjs.com/package/cloudevents-sdk) [![dependencies](https://david-dm.org/cloudevents/sdk-javascript.svg)](https://david-dm.org/cloudevents/sdk-javascript) +[![vulnerabilities](https://snyk.io/test/github/cloudevents/sdk-javascript/badge.svg)](https://snyk.io/test/github/cloudevents/sdk-javascript) # sdk-javascript @@ -12,6 +13,8 @@ Official CloudEvents' SDK for JavaScript. CloudEvents logo +__Checkout the [changelog](./CHANGELOG.md) to see what's going on!__ + ## Contributing Before create an awesome PR, please read our [guidelines](./CONTRIBUTING.md). diff --git a/lib/bindings/http/receiver_structured_0_3.js b/lib/bindings/http/receiver_structured_0_3.js index f5c04f1..45f0982 100644 --- a/lib/bindings/http/receiver_structured_0_3.js +++ b/lib/bindings/http/receiver_structured_0_3.js @@ -51,6 +51,10 @@ setterByAttribute[Constants.STRUCTURED_ATTRS_03.CONTENT_TYPE] = { name: "dataContentType", parser: (v) => v }; +setterByAttribute[Constants.STRUCTURED_ATTRS_03.SUBJECT] = { + name: "subject", + parser: (v) => v +}; setterByAttribute[Constants.STRUCTURED_ATTRS_03.DATA] = { name: "data", parser: (v) => v diff --git a/package.json b/package.json index 4e4ff35..8e1103b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudevents-sdk", - "version": "0.3.0", + "version": "0.3.1", "description": "CloudEvents SDK for JavaScript", "main": "index.js", "scripts": { @@ -32,7 +32,7 @@ "homepage": "https://github.com/cloudevents/sdk-javascript#readme", "dependencies": { "ajv": "^6.7.0", - "axios": "0.18.0", + "axios": "0.18.1", "is-empty": "1.2.0", "uri-js": "4.2.2", "uuid": "3.3.2" diff --git a/test/bindings/http/unmarshaller_0_3_tests.js b/test/bindings/http/unmarshaller_0_3_tests.js index 421b194..9304451 100644 --- a/test/bindings/http/unmarshaller_0_3_tests.js +++ b/test/bindings/http/unmarshaller_0_3_tests.js @@ -9,7 +9,7 @@ const webhook = "https://cloudevents.io/webhook"; const contentType = "application/cloudevents+json; charset=utf-8"; const now = new Date(); const schemaurl = "http://cloudevents.io/schema.json"; - +const subject = "subject.ext"; const ceContentType = "application/json"; const data = { @@ -118,9 +118,10 @@ describe("HTTP Transport Binding Unmarshaller for CloudEvents v0.3", () => { new Cloudevent(v03.Spec) .type(type) .source(source) - .contenttype(ceContentType) + .dataContentType(ceContentType) .time(now) .schemaurl(schemaurl) + .subject(subject) .data(data) .toString();