File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/client-side-encryption Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import { deserialize , type Document , serialize } from '../bson' ;
8
8
import { type CommandOptions , type ProxyOptions } from '../cmap/connection' ;
9
- import { MongoDBResponse } from '../cmap/wire_protocol/responses' ;
9
+ import { MongoDBResponse , type MongoDBResponseConstructor } from '../cmap/wire_protocol/responses' ;
10
10
import { getMongoDBClientEncryption } from '../deps' ;
11
11
import { MongoRuntimeError } from '../error' ;
12
12
import { MongoClient , type MongoClientOptions } from '../mongo_client' ;
@@ -484,6 +484,10 @@ export class AutoEncrypter {
484
484
? response
485
485
: serialize ( response , options ) ;
486
486
487
+ const responseType = MongoDBResponse . is ( response )
488
+ ? ( response . constructor as MongoDBResponseConstructor )
489
+ : undefined ;
490
+
487
491
const context = this . _mongocrypt . makeDecryptionContext ( buffer ) ;
488
492
489
493
context . id = this . _contextCounter ++ ;
@@ -495,7 +499,7 @@ export class AutoEncrypter {
495
499
} ) ;
496
500
497
501
const decorateResult = this [ kDecorateResult ] ;
498
- const result = await stateMachine . execute ( this , context , response . constructor ) ;
502
+ const result = await stateMachine . execute ( this , context , responseType ) ;
499
503
if ( decorateResult ) {
500
504
decorateDecryptionResult ( result , response ) ;
501
505
}
You can’t perform that action at this time.
0 commit comments