mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-07 07:42:13 +03:00
fix(security): avoid rendering error stacks (#5624)
Integrated into release/v3.8.43 (drift-shed: cherry-picked the real change onto the release tip; stale-base drift dropped).
This commit is contained in:
@@ -40,7 +40,6 @@ export default function Error({ error, reset }: ErrorProps) {
|
||||
aria-label="Error details"
|
||||
>
|
||||
{error.message}
|
||||
{error.stack && `\n\n${error.stack}`}
|
||||
</pre>
|
||||
)}
|
||||
<div className="flex gap-3">
|
||||
|
||||
12
tests/unit/error-boundary-stack.test.ts
Normal file
12
tests/unit/error-boundary-stack.test.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
|
||||
const repoRoot = join(import.meta.dirname, "../..");
|
||||
|
||||
test("app error boundary does not render stack traces", async () => {
|
||||
const source = await readFile(join(repoRoot, "src/app/error.tsx"), "utf8");
|
||||
|
||||
assert.doesNotMatch(source, /error\.stack/);
|
||||
});
|
||||
Reference in New Issue
Block a user