mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 04:41:32 +02:00
Filter out link-sharing token sent to Sentry (#25787)
GitOrigin-RevId: 647f1a2e20e7883f7ab9c862bb0d90cf96360c24
This commit is contained in:
@@ -73,6 +73,19 @@ function sentryReporter() {
|
||||
return null // Block the event from sending
|
||||
}
|
||||
|
||||
// Do not send link-sharing token to Sentry
|
||||
if (event.request?.headers?.Referer) {
|
||||
const refererUrl = new URL(event.request.headers.Referer)
|
||||
|
||||
if (
|
||||
refererUrl.hostname === location.hostname &&
|
||||
refererUrl.pathname.startsWith('/read/')
|
||||
) {
|
||||
refererUrl.pathname = '/read/'
|
||||
event.request.headers.Referer = refererUrl.toString()
|
||||
}
|
||||
}
|
||||
|
||||
return event
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user