@krx3d/tizentube2 1.31.380 → 1.31.400
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/service.js +26 -8
- package/dist/userScript.js +1 -1
- package/package.json +1 -1
package/dist/service.js
CHANGED
|
@@ -23473,6 +23473,15 @@ function requireRead() {
|
|
|
23473
23473
|
// read options
|
|
23474
23474
|
var encoding = opts.encoding !== null ? opts.encoding : null;
|
|
23475
23475
|
var verify = opts.verify;
|
|
23476
|
+
|
|
23477
|
+
// assert charset is supported before creating the decompression stream, so a
|
|
23478
|
+
// 415 cannot leave a decoder piped with no error listener
|
|
23479
|
+
if (verify && encoding !== null && !iconv.encodingExists(encoding)) {
|
|
23480
|
+
return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
|
23481
|
+
charset: encoding.toLowerCase(),
|
|
23482
|
+
type: 'charset.unsupported'
|
|
23483
|
+
}));
|
|
23484
|
+
}
|
|
23476
23485
|
try {
|
|
23477
23486
|
// get the content stream
|
|
23478
23487
|
stream = contentstream(req, debug, opts.inflate);
|
|
@@ -23486,14 +23495,6 @@ function requireRead() {
|
|
|
23486
23495
|
opts.length = length;
|
|
23487
23496
|
opts.encoding = verify ? null : encoding;
|
|
23488
23497
|
|
|
23489
|
-
// assert charset is supported
|
|
23490
|
-
if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {
|
|
23491
|
-
return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
|
23492
|
-
charset: encoding.toLowerCase(),
|
|
23493
|
-
type: 'charset.unsupported'
|
|
23494
|
-
}));
|
|
23495
|
-
}
|
|
23496
|
-
|
|
23497
23498
|
// read body
|
|
23498
23499
|
debug('read body');
|
|
23499
23500
|
getBody(stream, opts, function (error, body) {
|
|
@@ -23523,6 +23524,23 @@ function requireRead() {
|
|
|
23523
23524
|
return;
|
|
23524
23525
|
}
|
|
23525
23526
|
|
|
23527
|
+
// detach and destroy the decompression stream to avoid
|
|
23528
|
+
// decompression errors on the finished stream
|
|
23529
|
+
if (stream !== req) {
|
|
23530
|
+
// only detach the decompression stream, keep other consumers piped
|
|
23531
|
+
if (typeof req.unpipe === 'function') {
|
|
23532
|
+
req.unpipe(stream);
|
|
23533
|
+
} else {
|
|
23534
|
+
// Node.js 0.8 streams have no unpipe(dest)
|
|
23535
|
+
unpipe(req);
|
|
23536
|
+
}
|
|
23537
|
+
stream.on('error', function () {});
|
|
23538
|
+
destroy(stream, true);
|
|
23539
|
+
|
|
23540
|
+
// consume any remaining bytes so the HTTP request can finish
|
|
23541
|
+
req.resume();
|
|
23542
|
+
}
|
|
23543
|
+
|
|
23526
23544
|
// verify
|
|
23527
23545
|
if (verify) {
|
|
23528
23546
|
try {
|