[fix] handle buffers so we dont get ambiguous errors when we dont strictly read the file as utf8
This commit is contained in:
parent
54cab2059a
commit
4431c33162
1 changed files with 2 additions and 2 deletions
|
@ -38,8 +38,8 @@ var File = exports.File = function (options) {
|
|||
|| 2;
|
||||
|
||||
if (this.secure) {
|
||||
this.secure = typeof this.secure === 'string'
|
||||
? { secret: this.secure }
|
||||
this.secure = Buffer.isBuffer(this.secure) || typeof this.secure === 'string'
|
||||
? { secret: this.secure.toString() }
|
||||
: this.secure;
|
||||
|
||||
this.secure.alg = this.secure.alg || 'aes-256-ctr';
|
||||
|
|
Loading…
Reference in a new issue