Merge pull request #509 from alax/fix-v3-headers

V3 header generation was concat()-ing non-Uint8 arrays
This commit is contained in:
Bart Butler 2017-01-09 12:26:30 -08:00 committed by GitHub
commit 0d950d0a8a

View File

@ -97,9 +97,9 @@ export default {
if (length < 256) {
return new Uint8Array([0x80 | (tag_type << 2), length]);
} else if (length < 65536) {
return util.concatUint8Array([0x80 | (tag_type << 2) | 1, util.writeNumber(length, 2)]);
return util.concatUint8Array([new Uint8Array([0x80 | (tag_type << 2) | 1]), util.writeNumber(length, 2)]);
} else {
return util.concatUint8Array([0x80 | (tag_type << 2) | 2, util.writeNumber(length, 4)]);
return util.concatUint8Array([new Uint8Array([0x80 | (tag_type << 2) | 2]), util.writeNumber(length, 4)]);
}
},