If I use servless(app, {binary: true}) as per the docs, the default sniff function errors:
2021-11-24T08:47:20.786Z 4cb6d5ab-6ce3-4f41-9f7a-b119a747ff71 ERROR Invoke Error {"errorType":"TypeError","errorMessage":"candidate.replace is not a function","stack":["TypeError: candidate.replace is not a function","
at /var/task/node_modules/serverless-http/lib/provider/aws/is-binary.js:21:30","
at Array.map (<anonymous>)"," at isBinaryContent (/var/task/node_modules/serverless-http/lib/provider/aws/is-binary.js:20:5)"," at isBinary (/var/task/node_modules/serverless-http/lib/provider/aws/is-binary.js:37:39)","
at module.exports (/var/task/node_modules/serverless-http/lib/provider/aws/format-response.js:21:27)","
at Runtime.handler (/var/task/node_modules/serverless-http/lib/provider/aws/index.js:13:12)","
at processTicksAndRejections (internal/process/task_queues.js:95:5)"]}
If I use
servless(app, {binary: true})
as per the docs, the default sniff function errors:I believe this is because this line: https://github.com/dougmoscrop/serverless-http/blob/master/lib/provider/aws/is-binary.js#L17
contentTypes
ends up being[true]
.