feat: add allowHeaders to Options (#6044)

* feat: add allowHeaders to Options

This allows developers to use custom headers in their API requests, and they will be accepted by their mounted app.

* refactor: convert allowCrossDomain to generator to add appId in scope

This is necessary as the middleware may run in OPTIONS request that do not contain the appId within the header.

* chore: update Definitions and docs

* fix: update test to use new allowCrossDomain params

* chore: add tests for allowCustomDomain middleware re: allowHeadrs
This commit is contained in:
Omair Vaiyani
2019-09-12 22:03:57 +01:00
committed by Antonio Davi Macedo Coelho de Castro
parent 1361bb3020
commit eef530b1e3
7 changed files with 113 additions and 25 deletions

View File

@@ -145,7 +145,7 @@ class ParseServer {
// It's the equivalent of https://api.parse.com/1 in the hosted Parse API.
var api = express();
//api.use("/apps", express.static(__dirname + "/public"));
api.use(middlewares.allowCrossDomain);
api.use(middlewares.allowCrossDomain(appId));
// File handling needs to be before default middlewares are applied
api.use(
'/',