Skip to content

Commit b9bd2a7

Browse files
committed
Revert "fix: make application/json the default content type in binary mode (cloudevents#118)"
This reverts commit 9ccfaf2.
1 parent 28a9bf0 commit b9bd2a7

File tree

3 files changed

+0
-33
lines changed

3 files changed

+0
-33
lines changed

lib/bindings/http/receiver_binary.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ BinaryHTTPReceiver.prototype.check = function(payload, headers) {
5252
// Clone and low case all headers names
5353
const sanityHeaders = Commons.sanityAndClone(headers);
5454

55-
// If no content type is provided, default to application/json
56-
if (!sanityHeaders[Constants.HEADER_CONTENT_TYPE]) {
57-
sanityHeaders[Constants.HEADER_CONTENT_TYPE] = Constants.MIME_JSON;
58-
}
59-
6055
// Validation Level 1
6156
if (!this.allowedContentTypes
6257
.includes(sanityHeaders[Constants.HEADER_CONTENT_TYPE])) {

test/bindings/http/receiver_binary_0_3_tests.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,6 @@ describe("HTTP Transport Binding Binary Receiver for CloudEvents v0.3", () => {
144144
expect(receiver.check.bind(receiver, payload, attributes))
145145
.to.not.throw();
146146
});
147-
148-
it("No error when content-type is unspecified", () => {
149-
const payload = {};
150-
const attributes = {
151-
"ce-type": "type",
152-
"ce-specversion": "0.3",
153-
"ce-source": "source",
154-
"ce-id": "id"
155-
};
156-
157-
// act and assert
158-
expect(receiver.check.bind(receiver, payload, attributes))
159-
.to.not.throw();
160-
});
161147
});
162148

163149
describe("Parse", () => {

test/bindings/http/receiver_binary_1_tests.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,6 @@ describe("HTTP Transport Binding Binary Receiver for CloudEvents v1.0", () => {
130130
.to.throw("invalid content type");
131131
});
132132

133-
it("No error when content-type is unspecified", () => {
134-
const payload = {};
135-
const attributes = {
136-
"ce-type": "type",
137-
"ce-specversion": "1.0",
138-
"ce-source": "source",
139-
"ce-id": "id"
140-
};
141-
142-
// act and assert
143-
expect(receiver.check.bind(receiver, payload, attributes))
144-
.to.not.throw();
145-
});
146-
147133
it("No error when all required headers are in place", () => {
148134
// setup
149135
const payload = {};

0 commit comments

Comments
 (0)