Skip to content

lib: correct name of CONTENT_ENCODING constant #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/bindings/http/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = Object.freeze({
ID: "ce-id",
TIME: "ce-time",
SCHEMA_URL: "ce-schemaurl",
CONTENT_ENCONDING: "ce-datacontentencoding",
CONTENT_ENCODING: "ce-datacontentencoding",
SUBJECT: "ce-subject",
EXTENSIONS_PREFIX: "ce-"
},
Expand All @@ -43,7 +43,7 @@ module.exports = Object.freeze({
ID: "id",
TIME: "time",
SCHEMA_URL: "schemaurl",
CONTENT_ENCONDING: "datacontentencoding",
CONTENT_ENCODING: "datacontentencoding",
CONTENT_TYPE: "datacontenttype",
SUBJECT: "subject",
DATA: "data"
Expand Down
2 changes: 1 addition & 1 deletion lib/bindings/http/emitter_binary_0_3.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ headerByGetter.getDataContentType = {
};

headerByGetter.getDataContentEncoding = {
name: BINARY_HEADERS_03.CONTENT_ENCONDING,
name: BINARY_HEADERS_03.CONTENT_ENCODING,
parser: (v) => v
};

Expand Down
4 changes: 2 additions & 2 deletions lib/bindings/http/receiver_binary_0_3.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ setterByHeader[Constants.HEADER_CONTENT_TYPE] = {
name: "dataContentType",
parser: (v) => v
};
setterByHeader[Constants.BINARY_HEADERS_03.CONTENT_ENCONDING] = {
setterByHeader[Constants.BINARY_HEADERS_03.CONTENT_ENCODING] = {
name: "dataContentEncoding",
parser: (v) => v
};
Expand All @@ -82,7 +82,7 @@ function checkDecorator(payload, headers) {
Object.keys(headers)
.map((header) => header.toLocaleLowerCase("en-US"))
.filter((header) =>
header === Constants.BINARY_HEADERS_03.CONTENT_ENCONDING)
header === Constants.BINARY_HEADERS_03.CONTENT_ENCODING)
.filter((header) => !allowedEncodings.includes(headers[header]))
.forEach((header) => {
// TODO: using forEach here seems off
Expand Down
4 changes: 2 additions & 2 deletions test/bindings/http/unmarshaller_0_3_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe("HTTP Transport Binding Unmarshaller for CloudEvents v0.3", () => {
[BINARY_HEADERS_03.TIME]: "2019-06-16T11:42:00Z",
[BINARY_HEADERS_03.SCHEMA_URL]: "http://schema.registry/v1",
[HEADER_CONTENT_TYPE]: "application/json",
[BINARY_HEADERS_03.CONTENT_ENCONDING]: BINARY
[BINARY_HEADERS_03.CONTENT_ENCODING]: BINARY
};

expect(() => un.unmarshall(payload, attributes)).to
Expand All @@ -205,7 +205,7 @@ describe("HTTP Transport Binding Unmarshaller for CloudEvents v0.3", () => {
[BINARY_HEADERS_03.TIME]: "2019-06-16T11:42:00Z",
[BINARY_HEADERS_03.SCHEMA_URL]: "http://schema.registry/v1",
[HEADER_CONTENT_TYPE]: "application/json",
[BINARY_HEADERS_03.CONTENT_ENCONDING]: "base64"
[BINARY_HEADERS_03.CONTENT_ENCODING]: "base64"
};

const event = un.unmarshall(payload, attributes);
Expand Down
4 changes: 2 additions & 2 deletions test/constants_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe("Constants exposed by top level exports", () => {
expect(BINARY_HEADERS_03.SCHEMA_URL).to.equal("ce-schemaurl");
});
it("Provides a CONTENT_ENCODING header", () => {
expect(BINARY_HEADERS_03.CONTENT_ENCONDING).to.equal("ce-datacontentencoding");
expect(BINARY_HEADERS_03.CONTENT_ENCODING).to.equal("ce-datacontentencoding");
});
it("Provides a SUBJECT header", () => {
expect(BINARY_HEADERS_03.SUBJECT).to.equal("ce-subject");
Expand Down Expand Up @@ -121,7 +121,7 @@ describe("Constants exposed by top level exports", () => {
expect(STRUCTURED_ATTRS_03.SCHEMA_URL).to.equal("schemaurl");
});
it("Provides a CONTENT_ENCODING attribute", () => {
expect(STRUCTURED_ATTRS_03.CONTENT_ENCONDING).to.equal("datacontentencoding");
expect(STRUCTURED_ATTRS_03.CONTENT_ENCODING).to.equal("datacontentencoding");
});
it("Provides a SUBJECT attribute", () => {
expect(STRUCTURED_ATTRS_03.SUBJECT).to.equal("subject");
Expand Down