Skip to content

Commit b66363e

Browse files
committed
blob convert
1 parent 663143d commit b66363e

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/comms/isocket-comms.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,16 @@ class ISocketComms extends EventEmitter {
9999
debug('decrypting quantum aes')
100100
console.log(reply, typeof reply)
101101

102-
const contentBSON = await this.aesStream.decrypt( new Uint8Array(reply.data) )
102+
let buf = reply
103+
104+
if(buf instanceof Blob){
105+
debug('reply is a blob')
106+
buf = await reply.arrayBuffer();
107+
} else {
108+
buf = reply.data
109+
}
110+
111+
const contentBSON = await this.aesStream.decrypt( new Uint8Array(buf) )
103112
const content = Routines.BSON.parseObject(new Routines.BSON.BaseParser( contentBSON ))
104113

105114
return content

0 commit comments

Comments
 (0)