Skip to content

Commit 8ab8bf8

Browse files
committed
Fix the content-type http header validation for binary format
Signed-off-by: Fabio José <[email protected]>
1 parent 2116c5b commit 8ab8bf8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/bindings/http/unmarshaller_0_2.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ function validateArgs(payload, headers) {
3131
// Is it binary or structured?
3232
function resolveBindingName(payload, headers) {
3333

34-
var contentType = headers[Constants.HEADER_CONTENT_TYPE];
34+
var contentType =
35+
Array.of(headers[Constants.HEADER_CONTENT_TYPE])
36+
.map(c => c.split(";"))
37+
.map(c => c.shift())
38+
.shift();
39+
3540
if(contentType.startsWith(Constants.MIME_CE)){
3641
// Structured
3742
if(allowedStructuredContentTypes.includes(contentType)){

0 commit comments

Comments
 (0)