Skip to content

Commit 8bce38b

Browse files
committed
fix(api): use global rate limiter on read-only payment-provider-rules route
1 parent 25fc58c commit 8bce38b

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

apps/api/src/routes/addressbook.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
lookupByIbanSchema,
1616
} from '../middleware/validation.js';
1717
import { escapeRegex } from '../utils/index.js';
18-
import { sensitiveRateLimiter } from '../middleware/rate-limit.js';
1918

2019
const router = Router();
2120

@@ -82,7 +81,7 @@ function applyCleanupRules(name: string, rules: { pattern: string }[]): string {
8281
let cleaned = name;
8382
for (const rule of rules) {
8483
// All patterns are treated as literal strings (escaped) to prevent regex injection.
85-
// If pattern was stored with /regex/flags syntax, strip delimiters first.
84+
// If pattern was stored with /regex/flags syntax, strip delimiters and discard flags intentionally.
8685
let rawPattern = rule.pattern;
8786
if (rawPattern.startsWith('/') && rawPattern.lastIndexOf('/') > 0) {
8887
const lastSlash = rawPattern.lastIndexOf('/');
@@ -1701,7 +1700,7 @@ router.delete('/payment-providers/:id', (req, res) => {
17011700
* 200:
17021701
* description: Lijst met payment processor regels
17031702
*/
1704-
router.get('/payment-provider-rules', sensitiveRateLimiter, (_req, res) => {
1703+
router.get('/payment-provider-rules', (_req, res) => {
17051704
try {
17061705
// Ensure default payment provider rules exist
17071706
const defaultRules = [

0 commit comments

Comments
 (0)