parse-community / parse-community/parse-server
Setting bodyParser.text() breaks the authorisation
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
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
-
Server
- parse-server version (Be specific! Don't say 'latest'.) : "parse": "^2.11.0", "parse-server": "^4.1.0",
- Operating System: Amazon Linux
- Hardware: m3.medium
- Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): AWS
-
Database
- MongoDB version: 4.X
- Storage engine: SSD
- Hardware:
- Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): Atlas
Logs/Trace
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with bodyParser.text({ limit: '100mb' }) in an Express Parse Server using the reported Parse Server and parse JavaScript SDK versions. Check the authorization and CORS behavior for base64 POST bodies over 5MB, especially requests using content-type plain/text. Done means the larger request succeeds without breaking authorization or producing the browser-only CORS failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, javascript, node.js
- Domain
- api, authorization, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100