entexto-cli 2.1.0 → 2.1.1
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/lib/commands/tunnel.js +6 -2
- package/package.json +1 -1
package/lib/commands/tunnel.js
CHANGED
|
@@ -139,9 +139,13 @@ module.exports = async function tunnel(opts) {
|
|
|
139
139
|
const statusColor = status < 300 ? chalk.green(status) : status < 400 ? chalk.cyan(status) : chalk.red(status);
|
|
140
140
|
process.stdout.write(statusColor + ' ');
|
|
141
141
|
|
|
142
|
+
// SSE / event-stream y chunked (transfer-encoding) siempre van streaming real
|
|
143
|
+
const isSSE = /event-stream/i.test(ct);
|
|
144
|
+
const isChunked = /chunked/i.test(localRes.headers['transfer-encoding'] || '');
|
|
142
145
|
// Para responses de texto pequeños, acumular para poder reescribir URLs
|
|
143
|
-
// Para binarios o responses grandes, hacer streaming directo
|
|
144
|
-
const isSmallText = isText &&
|
|
146
|
+
// Para binarios, SSE, chunked o responses grandes, hacer streaming directo
|
|
147
|
+
const isSmallText = isText && !isSSE && !isChunked &&
|
|
148
|
+
localRes.headers['content-length'] && parseInt(localRes.headers['content-length']) < 5 * 1024 * 1024;
|
|
145
149
|
|
|
146
150
|
if (isSmallText) {
|
|
147
151
|
// Acumular texto para URL rewriting, luego enviar en un solo stream
|