Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/lib/error-reporting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ const SENSITIVE_KEY_PATTERN = /(?:password|secret|token|key|auth|cred)/i;
const VERCEL_BLOB_TOKEN_PATTERN = /vercel_blob_rw_[a-zA-Z0-9_-]+/g;

function sanitizeString(data: string): string {
// Performance optimization: Fast-path check using String.prototype.includes to skip
// RegExp execution when the token prefix is absent (~60% speedup on non-matching strings).
if (!data.includes("vercel_blob_rw_")) return data;
return data.replace(VERCEL_BLOB_TOKEN_PATTERN, "[REDACTED_VERCEL_BLOB_TOKEN]");
}

Expand Down