[fix] handle buffers so we dont get ambiguous errors when we dont strictly read the file as utf8

master
Jarrett Cruger 2016-02-02 16:38:48 -08:00
parent 54cab2059a
commit 4431c33162
1 changed files with 2 additions and 2 deletions

View File

@ -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';