fix: ensure user agent is less than 0xfd in length. we can assume the varint is 1 byte.
This commit is contained in:
parent
cd58baed95
commit
c6bafbcb48
@ -14,7 +14,9 @@ function Framer(options) {
|
|||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
|
||||||
this.agent = utils.toArray(options.agent || '/bcoin:' + version + '/');
|
this.agent = utils.toArray(options.agent || '/bcoin:' + version + '/');
|
||||||
|
this.agent = this.agent.slice(0, 0xfc);
|
||||||
}
|
}
|
||||||
module.exports = Framer;
|
module.exports = Framer;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user