当配置中包含 `httpAgent`/`httpsAgent` 时,`AxiosError.prototype.toJSON()` 可能会 OOM
作者: skrtheboss创建于 2026年8月12日更新于 2026年8月25日
`AxiosError.prototype.toJSON()` calls `utils.toJSONObject(this.config)` unconditionally. `toJSONObject`'s cycle detection is ancestor-path-only (it tracks the current recursion path, not a global "already visited" set). This appears intentional — it preserves correct serialization of shared sibling/DAG references instead of silently dropping them. The tradeoff: any object reachable via multiple distinct paths gets fully re-serialized once per path.
内容来源: axios/axios