Skip to content

Commit 9d05b01

Browse files
committed
Proxy canonize on cryptosuite itself.
1 parent b4709ea commit 9d05b01

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/suites/algorithms.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,18 @@ function stubUnsafe(suite) {
248248
if(typeof suite !== 'object') {
249249
return suite;
250250
}
251+
// if the suite has a cryptosuite object proxy it
252+
if(suite._cryptosuite) {
253+
suite._cryptosuite = new Proxy(suite._cryptosuite, {
254+
get(target, prop) {
255+
if(prop === 'canonize') {
256+
return function(doc, options) {
257+
return suite._cryptosuite.canonize(doc, {...options, safe: false});
258+
};
259+
}
260+
}
261+
});
262+
}
251263
return new Proxy(suite, {
252264
get(target, prop) {
253265
if(prop === 'canonize') {

0 commit comments

Comments
 (0)