Make sure we don't try to get metadata for blobs
This commit is contained in:
@@ -1266,6 +1266,9 @@ define([
|
||||
var _parsed = Utils.Hash.parsePadUrl(metadata.roHref);
|
||||
_secret = Utils.Hash.getSecrets(_parsed.type, _parsed.hash, metadata.password);
|
||||
}
|
||||
if (_secret.channel.length !== 32) {
|
||||
return void cb({error: 'EINVAL'});
|
||||
}
|
||||
var crypto = Crypto.createEncryptor(_secret.keys);
|
||||
nThen(function (waitFor) {
|
||||
// Try to get the owner's mailbox from the pad metadata first.
|
||||
@@ -1325,6 +1328,9 @@ define([
|
||||
var _parsed = Utils.Hash.parsePadUrl(metadata.href || metadata.roHref);
|
||||
_secret = Utils.Hash.getSecrets(_parsed.type, _parsed.hash, metadata.password);
|
||||
}
|
||||
if (_secret.channel.length !== 32) {
|
||||
return void cb({error: 'EINVAL'});
|
||||
}
|
||||
var crypto = Crypto.createEncryptor(_secret.keys);
|
||||
nThen(function (waitFor) {
|
||||
// If we already have metadata, use it, otherwise, try to get it
|
||||
|
||||
Reference in New Issue
Block a user