Debug-log every API request and response
check / check (push) Has been cancelled

Add debugFetch wrapper in log.js that logs method, URL, and body on
request, and status code on response. Replace all fetch() calls
across balances, transactions, tokens, background RPC proxy, and
settings validation with debugFetch.
이 커밋은 다음에 포함됨:
2026-02-26 15:40:09 +07:00
부모 47e690f466
커밋 d24c10ca9c
6개의 변경된 파일과 24개의 추가작업 그리고 11개의 파일을 삭제
+3 -3
파일 보기
@@ -1,7 +1,7 @@
const { $, showView, showFlash } = require("./helpers");
const { state, saveState } = require("../../shared/state");
const { ETHEREUM_MAINNET_CHAIN_ID } = require("../../shared/constants");
const { log } = require("../../shared/log");
const { log, debugFetch } = require("../../shared/log");
const runtime =
typeof browser !== "undefined" ? browser.runtime : chrome.runtime;
@@ -56,7 +56,7 @@ function init(ctx) {
}
showFlash("Testing endpoint...");
try {
const resp = await fetch(url, {
const resp = await debugFetch(url, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
@@ -98,7 +98,7 @@ function init(ctx) {
}
showFlash("Testing endpoint...");
try {
const resp = await fetch(url + "/stats");
const resp = await debugFetch(url + "/stats");
if (!resp.ok) {
showFlash("Endpoint returned HTTP " + resp.status + ".");
return;