parse-community / parse-community/parse-server

Setting bodyParser.text() breaks the authorisation

Open
#6,750 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.