Skip to content

Commit

Permalink
fix: extend header denylist (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Nov 14, 2023
1 parent b16a062 commit 6b70edb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/extensions/replay/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,24 @@ export const defaultNetworkOptions: NetworkRecordOptions = {
recordInitialRequests: false,
}

const HEADER_DENYLIST = [
'Authorization',
'X-FORWARDED-FOR',
'AUTHORIZATION',
'COOKIE',
'SET-COOKIE',
'X-API-KEY',
'X-REAL-IP',
'REMOTE-ADDR',
'FORWARDED',
'PROXY-AUTHORIZATION',
'X-CSRF-TOKEN',
'X-CSRFTOKEN',
'X-XSRF-TOKEN',
]

const removeAuthorizationHeader = (data: NetworkRequest): NetworkRequest => {
delete data.requestHeaders?.['Authorization']
HEADER_DENYLIST.forEach((header) => delete data.requestHeaders?.[header])
return data
}

Expand Down

0 comments on commit 6b70edb

Please sign in to comment.