Skip to content

Commit 8c2b2ff

Browse files
christopherholland-workdaygemini-code-assist[bot]yau-wd
authored
Always include default deny list in deny list values (#5708)
* Always include default deny list in deny list values * Update packages/components/src/httpSecurity.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Always include default deny list in deny list values --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: yau-wd <yau.ong@workday.com>
1 parent 5e5fa60 commit 8c2b2ff

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

packages/components/src/httpSecurity.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,19 @@ const DEFAULT_DENY_LIST = [
2727
]
2828

2929
/**
30-
* Gets the HTTP deny list from environment variable or returns default
31-
* @returns Array of denied IP addresses/CIDR ranges
30+
* Gets the HTTP deny list, always including default protections plus any custom entries
31+
* @returns Array of denied IP addresses/CIDR ranges (always includes DEFAULT_DENY_LIST)
3232
*/
3333
function getHttpDenyList(): string[] {
3434
const httpDenyListString = process.env.HTTP_DENY_LIST
35-
return httpDenyListString ? httpDenyListString.split(',').map((s) => s.trim()) : DEFAULT_DENY_LIST
35+
if (httpDenyListString) {
36+
const customList = httpDenyListString
37+
.split(',')
38+
.map((s) => s.trim())
39+
.filter(Boolean)
40+
return [...new Set([...DEFAULT_DENY_LIST, ...customList])]
41+
}
42+
return DEFAULT_DENY_LIST
3643
}
3744

3845
/**

0 commit comments

Comments
 (0)