Files
flyer-crawler.projectium.com/src/utils/rateLimit.ts
Torben Sorensen 136a9ce3f3
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 17m3s
Add ADR-054 for Bugsink to Gitea issue synchronization and frontend testing summary for 2026-01-18
- Introduced ADR-054 detailing the implementation of an automated sync worker to create Gitea issues from unresolved Bugsink errors.
- Documented architecture, queue configuration, Redis schema, and implementation phases for the sync feature.
- Added frontend testing summary for 2026-01-18, covering multiple sessions of API testing, fixes applied, and Bugsink error tracking status.
- Included detailed API reference and common validation errors encountered during testing.
2026-01-18 01:35:00 -08:00

17 lines
485 B
TypeScript

// src/utils/rateLimit.ts
import { Request } from 'express';
const isTestEnv =
process.env.NODE_ENV === 'test' ||
process.env.NODE_ENV === 'development' ||
process.env.NODE_ENV === 'staging';
/**
* Helper to determine if rate limiting should be skipped.
* Skips in test environment unless explicitly enabled via header.
*/
export const shouldSkipRateLimit = (req: Request) => {
if (!isTestEnv) return false;
return req.headers['x-test-rate-limit-enable'] !== 'true';
};