We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 551fbf7 commit d2016a5Copy full SHA for d2016a5
1 file changed
index.html
@@ -452,11 +452,18 @@
452
}
453
454
455
- console.log(`HTTP ${method} ${url}`, {
456
- bodySize: requestBody?.length,
457
- bodyType: requestBody?.constructor?.name,
458
- bodyStart: requestBody ? new TextDecoder().decode(requestBody.slice(0, 50)) : null
459
- });
+ if (requestBody) {
+ const preview = requestBody instanceof Uint8Array
+ ? new TextDecoder().decode(requestBody.slice(0, 50))
+ : String(requestBody).slice(0, 50);
+ console.log(`HTTP ${method} ${url}`, {
460
+ bodySize: requestBody.length || requestBody.byteLength,
461
+ bodyType: requestBody.constructor?.name,
462
+ bodyStart: preview
463
+ });
464
+ } else {
465
+ console.log(`HTTP ${method} ${url} (no body)`);
466
+ }
467
468
// Make the request
469
const res = await fetch(url, {
0 commit comments