#Raw Body Request

3 messages · Page 1 of 1 (latest)

tawdry yoke
#

According to https://docs.nestjs.com/faq/raw-body you just need to add the

{
  rawBody: true,
}

to receive rawBody, now I believe that will enable rawBody for every POST request, but I just wanted to use this in a single stripe webhook api route, just wanted to know if this is a safe practice to do, are there any cons to this?

Another suggestion I've found is to create a middleware such as suggested https://stackoverflow.com/questions/54346465/access-raw-body-of-stripe-webhook-in-nest-js. Now just adding a rawBody: true in bootstrap is very convenient, just wanna know what other thoughts are to this

subtle anvil
#

@tawdry yokedid you found any solution for this?

normal parcel
#

The solution is right there laid for you in the official documentation, why would you question whether it's a safe practise?