Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scyther opened this issue Mar 8, 2024 · 1 comment · Fixed by #541
Labels
bug Something isn't working

Comments

@scyther
Copy link

scyther commented Mar 8, 2024

/** 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
Copy link
Member

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

@KnorpelSenf KnorpelSenf added the bug Something isn't working label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants