-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I'm struggling with a binary response in an HttpAPI.
My endpoint is this
const CreateSetEndpoint = HttpApiEndpoint.post("createSet", "/create-set").addSuccess(
Schema.Uint8ArrayFromSelf.pipe(
HttpApiSchema.withEncoding({
kind: "Uint8Array",
contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
})
)
);
// implementation is type-safe, so omited for brevity
export const handler = LambdaHandler.fromHttpApi(
Layer.mergeAll(HeraklesApiLive, HttpServer.layerContext)
);I can compile and deploy it as a HttpApi. Calls to the endpoint return a file, but the file is corrupted. I checked the business logic which works fine, so the problem must happen somewhere on the API side.
I checked the tests and there is no test for binary responses at the moment. When checking the code I was wondering whether the logic here is correct https://github.com/floydspace/effect-aws/blob/92a98b16f412edb4a74708fe19e5aa8daf96dd11/packages/lambda/src/LambdaHandler.ts#L291C1-L293C49
If so, then the check here
| export const isContentTypeBinary = (contentType: string) => { |
Metadata
Metadata
Assignees
Labels
No labels