parse-community / parse-server

Parse Server for Node.js / Express
https://parseplatform.org
Apache License 2.0
20.9k stars 4.78k forks source link

Setting bodyParser.text() breaks the authorisation #6750

Open srameshr opened 4 years ago

srameshr commented 4 years ago

Issue Description

app.use(bodyParser.text({ limit: '100mb' })); Setting this in express breaks parse server authorisation.

Steps to reproduce

Send a base64 object greater than 5MB in the post request and it breaks with a CORS error. I am assuming its because parse js-sdk calls cloud functions with content-type: plain/text.

So, to fix this, if I try to increase limit in the middleware authorisation breaks.

Expected Results

Work as expected

Actual Outcome

A CORS error with no error code but just fails via the browser.

Environment Setup

Logs/Trace

mtrezza commented 3 years ago

Thank you for reporting.

Would you want to open a PR and start by writing a failing test case for this?