Skip to content

Commit ee150f2

Browse files
committed
fixup: fix getMode logic
Signed-off-by: Lance Ball <[email protected]>
1 parent 91fc801 commit ee150f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/message/http/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ function getMode(headers: Headers): Mode {
113113
return Mode.BATCH;
114114
} else if (contentType.startsWith(CONSTANTS.MIME_CE)) {
115115
return Mode.STRUCTURED;
116-
} else if (headers[CONSTANTS.CE_HEADERS.ID]) {
117-
return Mode.BINARY;
118116
}
119117
}
118+
119+
if (headers[CONSTANTS.CE_HEADERS.ID]) {
120+
return Mode.BINARY;
121+
}
120122
throw new ValidationError("no cloud event detected");
121123
}
122124

0 commit comments

Comments
 (0)