upstash / qstash-js

Message queue for serverless
https://docs.upstash.com/qstash
MIT License
133 stars 11 forks source link

Allow opting out of request body parsing #28

Closed sarimabbas closed 1 year ago

sarimabbas commented 1 year ago

Hello! Thanks so much for your work on this library!

I was wondering about your rationale for parsing the req.body in the Next.js verifySignature function. Is it mostly to provide convenience to the end-user?

I wanted to propose a config option to opt out of this behavior so that the request stream is not consumed. It would help me retain the raw request that I could use for other purposes.

Would appreciate your feedback. Thank you!

chronark commented 1 year ago

Yeah it mimics the behaviour of Next.js where the body is parsed if the content type is json.

Can you tell me your usecase and why this is not desirable for you?

sarimabbas commented 1 year ago

Yeah it mimics the behaviour of Next.js where the body is parsed if the content type is json.

Can you tell me your usecase and why this is not desirable for you?

Hello! Sorry for the delay in response!

My use-case was admittedly a bit of a niche one, and upon further reading I saw that it made more sense for me to restructure my code, and use the Receiver to verify the request. So I think this PR may not actually be required 😅 Sorry about that!