owlservable 0.2.5 → 0.2.6
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/index.cjs +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -200,8 +200,8 @@ function patchHttpModule(mod, protocol) {
|
|
|
200
200
|
const ct = res.headers['content-type'] || ''
|
|
201
201
|
const isJson = ct.includes('application/json')
|
|
202
202
|
const isSse = ct.includes('text/event-stream')
|
|
203
|
-
const r = addRequest({ url, method: method.toUpperCase(), status: res.statusCode, latency: Date.now() - start, reqBody, metaPending: isJson
|
|
204
|
-
if (r &&
|
|
203
|
+
const r = addRequest({ url, method: method.toUpperCase(), status: res.statusCode, latency: Date.now() - start, reqBody, metaPending: isJson })
|
|
204
|
+
if (r && isJson) {
|
|
205
205
|
try {
|
|
206
206
|
const chunks = []; let size = 0
|
|
207
207
|
res.on('data', chunk => { try { if (size < MAX_PARSE) { chunks.push(chunk); size += chunk.length } } catch (_) {} })
|
package/index.js
CHANGED
|
@@ -200,8 +200,8 @@ function patchHttpModule(mod, protocol) {
|
|
|
200
200
|
const ct = res.headers['content-type'] || ''
|
|
201
201
|
const isJson = ct.includes('application/json')
|
|
202
202
|
const isSse = ct.includes('text/event-stream')
|
|
203
|
-
const r = addRequest({ url, method: method.toUpperCase(), status: res.statusCode, latency: Date.now() - start, reqBody, metaPending: isJson
|
|
204
|
-
if (r &&
|
|
203
|
+
const r = addRequest({ url, method: method.toUpperCase(), status: res.statusCode, latency: Date.now() - start, reqBody, metaPending: isJson })
|
|
204
|
+
if (r && isJson) {
|
|
205
205
|
try {
|
|
206
206
|
const chunks = []; let size = 0
|
|
207
207
|
res.on('data', chunk => { try { if (size < MAX_PARSE) { chunks.push(chunk); size += chunk.length } } catch (_) {} })
|