yuudachi icon indicating copy to clipboard operation
yuudachi copied to clipboard

Framework does not support integer choices

Open almostSouji opened this issue 10 months ago • 0 comments

https://github.com/Naval-Base/yuudachi/blob/e398023952eeb2451af2c29884d9b848a5051985/packages/http/src/util/verifyRequest.ts#L16

Verification has to happen with the raw body, not the stringified JSON body. Discord sends "1.0" for integers, which is parsed to "1", failing the hash comparison.

Getting the raw body seems to be annoyingly complicated in fastify: https://www.npmjs.com/package/fastify-raw-body

almostSouji avatar Apr 22 '24 18:04 almostSouji