Skip to content

Commit

Permalink
Fix formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
taeold committed Nov 21, 2024
1 parent dc7a4ca commit ddc4897
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions spec/common/providers/https.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,13 +814,18 @@ describe("onCallHandler", () => {
{
cors: { origin: true, methods: "POST" },
},
(req, resp) => {
() => {
return "hello world";
},
"gcfv1"
);
const resp = await runHandler(fn, mockReq);
expect(JSON.parse(resp.body)).to.deep.equal({ "error": { "status": "INVALID_ARGUMENT", "message": "Unsupported Accept header 'text/event-stream'" } });
expect(JSON.parse(resp.body)).to.deep.equal({
error: {
status: "INVALID_ARGUMENT",
message: "Unsupported Accept header 'text/event-stream'",
},
});
});
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/common/providers/https.ts
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ function wrapOnCallHandler<Req = any, Res = any>(

if (acceptsStreaming && version === "gcfv1") {
// streaming responses are not supported in v1 callable
throw new HttpsError('invalid-argument', "Unsupported Accept header 'text/event-stream'")
throw new HttpsError("invalid-argument", "Unsupported Accept header 'text/event-stream'");
}

const data: Req = decode(req.body.data);
Expand Down Expand Up @@ -844,5 +844,5 @@ function wrapOnCallHandler<Req = any, Res = any>(
res.status(status).send(body);
}
}
}
};
};
}

0 comments on commit ddc4897

Please sign in to comment.