All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 17m3s
- 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.
17 lines
485 B
TypeScript
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';
|
|
};
|