grammyjs / grammY

The Telegram Bot Framework.
https://grammy.dev
MIT License
2.17k stars 110 forks source link

WebHook Reply doesnt work with Fastify Adapter as { content-type': 'application/json'} is missing from headers . #540

Closed scyther closed 5 months ago

scyther commented 6 months ago
/** fastify web framework */
const fastify: FrameworkAdapter = (req, reply) => ({
    update: Promise.resolve(req.body),
    header: req.headers[SECRET_HEADER_LOWERCASE],
    end: () => reply.status(200).send(),
    respond: (json) => reply.send(json),
    unauthorized: () => reply.code(401).send(WRONG_TOKEN_ERROR),
});

instead of respond: (json) => reply.send(json) it should be respond: (json) => reply.headers({'content-type': 'application/json'}).send(json)

KnorpelSenf commented 6 months ago

I'm surprised that nobody discovered this earlier, thanks for reporting. Could you review #541 and approve it if it is correct?