Skip to content

Commit 9e079b4

Browse files
committed
add resToRawResultFn in API GW
1 parent 033e39a commit 9e079b4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/cubejs-api-gateway/src/gateway.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,17 @@ class ApiGateway {
19931993
return (message, { status }: { status?: number } = {}) => (status ? res.status(status).json(message) : res.json(message));
19941994
}
19951995

1996+
protected resToRawResultFn(res: ExpressResponse) {
1997+
return (jsonBuffer: ArrayBuffer, { status }: { status?: number } = {}) => {
1998+
if (status) {
1999+
res.status(status);
2000+
}
2001+
2002+
res.set('Content-Type', 'application/json');
2003+
res.send(jsonBuffer);
2004+
};
2005+
}
2006+
19962007
protected parseQueryParam(query): Query | Query[] {
19972008
if (!query || query === 'undefined') {
19982009
throw new UserError('Query param is required');

0 commit comments

Comments
 (0)