Skip to content

Commit

Permalink
(fix) enhance logger cleansing of notification urls (#435)
Browse files Browse the repository at this point in the history
cleanse notifiarr url

current console output
` notificationWebhookUrl:
'https://notifiarr.com/api/v1/notification/crossSeed/[REDACTED]-1234-568-9d05-1fghj1i678uik',`

this changes from /w to 0-9-a-zA-Z_- which covers `-` as well as `/w` 

also aligns regex with the torznab logic for consistency
  • Loading branch information
mmgoodnow committed Jun 25, 2023
2 parents 5f9af42 + c04d654 commit 02c4f19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function redactMessage(message: string | unknown) {
// redact torznab api keys
ret = ret.replace(/apikey=[a-zA-Z0-9]+/g, `apikey=${redactionMsg}`);
ret = ret.replace(
/\/notification\/crossSeed\/\w+/g,
/\/notification\/crossSeed\/[a-zA-Z-0-9_-]+/g,
`/notification/crossSeed/${redactionMsg}`
);
for (const [key, urlStr] of Object.entries(runtimeConfig)) {
Expand Down

0 comments on commit 02c4f19

Please sign in to comment.