@@ -35,7 +35,7 @@ function handleParseHeaders(req, res, next) {
3535
3636 var fileViaJSON = false ;
3737
38- if ( ! info . appId || ! cache . apps [ info . appId ] ) {
38+ if ( ! info . appId || ! cache . apps . get ( info . appId ) ) {
3939 // See if we can find the app id on the body.
4040 if ( req . body instanceof Buffer ) {
4141 // The only chance to find the app id is if this is a file
@@ -44,12 +44,10 @@ function handleParseHeaders(req, res, next) {
4444 fileViaJSON = true ;
4545 }
4646
47- if ( req . body && req . body . _ApplicationId
48- && cache . apps [ req . body . _ApplicationId ]
49- && (
50- ! info . masterKey
51- ||
52- cache . apps [ req . body . _ApplicationId ] [ 'masterKey' ] === info . masterKey )
47+ if ( req . body &&
48+ req . body . _ApplicationId &&
49+ cache . apps . get ( req . body . _ApplicationId ) &&
50+ ( ! info . masterKey || cache . apps . get ( req . body . _ApplicationId ) . masterKey === info . masterKey )
5351 ) {
5452 info . appId = req . body . _ApplicationId ;
5553 info . javascriptKey = req . body . _JavaScriptKey || '' ;
@@ -84,9 +82,8 @@ function handleParseHeaders(req, res, next) {
8482 req . body = new Buffer ( base64 , 'base64' ) ;
8583 }
8684
87- info . app = cache . apps [ info . appId ] ;
85+ info . app = cache . apps . get ( info . appId ) ;
8886 req . config = new Config ( info . appId , mount ) ;
89- req . database = req . config . database ;
9087 req . info = info ;
9188
9289 var isMaster = ( info . masterKey === req . config . masterKey ) ;
0 commit comments