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:
committed by
Antonio Davi Macedo Coelho de Castro
parent
1361bb3020
commit
eef530b1e3
@@ -17,6 +17,11 @@ module.exports.ParseServerOptions = {
|
||||
action: parsers.booleanParser,
|
||||
default: true,
|
||||
},
|
||||
allowHeaders: {
|
||||
env: 'PARSE_SERVER_ALLOW_HEADERS',
|
||||
help: 'Add headers to Access-Control-Allow-Headers',
|
||||
action: parsers.arrayParser,
|
||||
},
|
||||
analyticsAdapter: {
|
||||
env: 'PARSE_SERVER_ANALYTICS_ADAPTER',
|
||||
help: 'Adapter module for the analytics',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* @interface ParseServerOptions
|
||||
* @property {Any} accountLockout account lockout policy for failed login attempts
|
||||
* @property {Boolean} allowClientClassCreation Enable (or disable) client class creation, defaults to true
|
||||
* @property {String[]} allowHeaders Add headers to Access-Control-Allow-Headers
|
||||
* @property {Adapter<AnalyticsAdapter>} analyticsAdapter Adapter module for the analytics
|
||||
* @property {String} appId Your Parse Application ID
|
||||
* @property {String} appName Sets the app name
|
||||
|
||||
@@ -26,6 +26,8 @@ export interface ParseServerOptions {
|
||||
masterKeyIps: ?(string[]);
|
||||
/* Sets the app name */
|
||||
appName: ?string;
|
||||
/* Add headers to Access-Control-Allow-Headers */
|
||||
allowHeaders: ?(string[]);
|
||||
/* Adapter module for the analytics */
|
||||
analyticsAdapter: ?Adapter<AnalyticsAdapter>;
|
||||
/* Adapter module for the files sub-system */
|
||||
|
||||
Reference in New Issue
Block a user