#Pete - JSON Payload Limit

1 messages · Page 1 of 1 (latest)

blissful pelican
#

Hi Pete. What was the limit set to before this change?

young bobcat
#

whatever the default is on express (i think like 150k?)

#

I updated it via:

#
app.use((req: express.Request, res: express.Response, next: express.NextFunction): void => {
    if (req.originalUrl === '/webhook/stripe') {
        next();
    } else {
        express.json({ limit: '10mb' })(req, res, next);
    }
});
#

I forgot that setting it globally wasn't something that the stripe webhook wanted.

#

raw vs json 🤦‍♂️

#

another id10t error by me, the developer 😄

#

Thanks for the response though and have a lovely day!

blissful pelican
#

No worries!