Pass context in beforeDelete, afterDelete, beforeFind and Parse.Cloud.run. (#6666)
* add context for following hooks. 1. beforeDelete 2. afterDelete 3. beforeFind 4. Cloud Function * revert un-necessary code change. * fix: failing test cases. * fix: failing test cases. * fix: failing test cases. * fix: failing test cases. * fix: failing test cases. * fix: failing test cases. * fix: failing test cases. * review changes * revert changes * revert changes * review changes * lint changes * review changes
This commit is contained in:
@@ -33,6 +33,7 @@ export function handleParseHeaders(req, res, next) {
|
||||
dotNetKey: req.get('X-Parse-Windows-Key'),
|
||||
restAPIKey: req.get('X-Parse-REST-API-Key'),
|
||||
clientVersion: req.get('X-Parse-Client-Version'),
|
||||
context: {},
|
||||
};
|
||||
|
||||
var basicAuth = httpAuth(req);
|
||||
@@ -103,6 +104,10 @@ export function handleParseHeaders(req, res, next) {
|
||||
info.masterKey = req.body._MasterKey;
|
||||
delete req.body._MasterKey;
|
||||
}
|
||||
if (req.body._context && req.body._context instanceof Object) {
|
||||
info.context = req.body._context;
|
||||
delete req.body._context;
|
||||
}
|
||||
if (req.body._ContentType) {
|
||||
req.headers['content-type'] = req.body._ContentType;
|
||||
delete req.body._ContentType;
|
||||
|
||||
Reference in New Issue
Block a user