mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-19 14:48:59 +00:00
Pass more tests
- Allow leading spaces in headers (since we were already accepting leading spaces everywhere else in the armored text). - Read ReadableStreams before passing them to a Worker
This commit is contained in:
@@ -112,7 +112,7 @@ AsyncProxy.prototype.getID = function() {
|
||||
*/
|
||||
AsyncProxy.prototype.seedRandom = async function(workerId, size) {
|
||||
const buf = await crypto.random.getRandomBytes(size);
|
||||
this.workers[workerId].postMessage({ event:'seed-random', buf }, util.getTransferables(buf));
|
||||
this.workers[workerId].postMessage({ event:'seed-random', buf }, await util.prepareBuffers(buf));
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -143,9 +143,10 @@ AsyncProxy.prototype.delegate = function(method, options) {
|
||||
}
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
// clone packets (for web worker structured cloning algorithm)
|
||||
this.workers[workerId].postMessage({ id:id, event:method, options:packet.clone.clonePackets(options) }, util.getTransferables(options));
|
||||
const transferables = await util.prepareBuffers(options);
|
||||
this.workers[workerId].postMessage({ id:id, event:method, options:packet.clone.clonePackets(options) }, transferables);
|
||||
this.workers[workerId].requests++;
|
||||
|
||||
// remember to handle parsing cloned packets from worker
|
||||
|
||||
Reference in New Issue
Block a user