mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Log a warning when a user is rejected from accessing real-time by CORS
GitOrigin-RevId: 04a7ffbc24654c876688db446164bf36a162828f
This commit is contained in:
@@ -95,6 +95,12 @@ io.configure(function () {
|
||||
const originIsValid = allowedCorsOriginsRegex.test(normalizedOrigin)
|
||||
|
||||
if (req.headers.origin) {
|
||||
if (!originIsValid) {
|
||||
logger.warn(
|
||||
{ normalizedOrigin, origin, req },
|
||||
'Origin header does not match allowed origins'
|
||||
)
|
||||
}
|
||||
return originIsValid
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user