Skip to content

Commit a3f47af

Browse files
authored
Chore/deny list urls (#4938)
* Refactor URL filtering logic in App class - Introduced a denylist for URLs using the DENYLIST_URLS environment variable. - Updated the whitelist logic to filter out denylisted URLs, ensuring improved request validation. * revery whitelist url changes * revert whitelist url changes
1 parent d081221 commit a3f47af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export class App {
210210
// Step 2: Check if the req path is casesensitive
211211
if (URL_CASE_SENSITIVE_REGEX.test(req.path)) {
212212
// Step 3: Check if the req path is in the whitelist
213-
const isWhitelisted = whitelistURLs.includes(req.path)
213+
const isWhitelisted = whitelistURLs.some((url) => req.path.startsWith(url))
214214
if (isWhitelisted) {
215215
next()
216216
} else if (req.headers['x-request-from'] === 'internal') {

0 commit comments

Comments
 (0)