add comment and replace the deprecated new Buffer() with Buffer.from()

This commit is contained in:
砚然 2017-12-30 13:34:38 +08:00
parent 52582bee07
commit ecb9a71eb1

View File

@ -139,8 +139,9 @@ function fetchRemoteResponse(protocol, options, reqData, config) {
refactContentEncoding(); refactContentEncoding();
try { try {
// an Unit8Array returned by decompression
const result = brotliTorb.decompress(serverResData); const result = brotliTorb.decompress(serverResData);
fulfill(new Buffer(result)); fulfill(Buffer.from(result));
} catch (e) { } catch (e) {
rejectParsing(e); rejectParsing(e);
} }