Skip to content

Commit

Permalink
Enhance header filtering in getHeadersApplicableToAllResources functi…
Browse files Browse the repository at this point in the history
…on to exclude falsy values
  • Loading branch information
ivanvakulov committed Dec 17, 2024
1 parent d46279a commit b97c2de
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/utils/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export function getHeadersApplicableToAllResources(headers: SecurityHeaders) {
Object.entries(headers)
.filter(([key]) => appliesToAllResources(key as OptionKey))
.map(([key, value]) => ([getNameFromKey(key as OptionKey), headerStringFromObject(key as OptionKey, value)]))
.filter(([_, value]) => Boolean(value))

Check warning on line 180 in src/utils/headers.ts

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

'_' is defined but never used
)
return Object.keys(applicableHeaders).length === 0 ? undefined : applicableHeaders
}
Expand Down

0 comments on commit b97c2de

Please sign in to comment.