mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 06:09:02 +02:00
Allow an empty origin request in real-time
This will only happen with a same-origin request (or if someone has tampered with the request - in which case they could set anything). Co-authored-by: Tim Down <158919+timdown@users.noreply.github.com> GitOrigin-RevId: 9dfe49f974a476bfe215768d3984dd60a381d37a
This commit is contained in:
Generated
+1
-1
@@ -44351,7 +44351,7 @@
|
||||
"lodash": "^4.17.21",
|
||||
"proxy-addr": "^2.0.7",
|
||||
"request": "^2.88.2",
|
||||
"socket.io": "github:overleaf/socket.io#0.9.19-overleaf-11",
|
||||
"socket.io": "github:overleaf/socket.io#0.9.19-overleaf-12",
|
||||
"socket.io-client": "github:overleaf/socket.io-client#0.9.17-overleaf-5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -91,6 +91,11 @@ io.configure(function () {
|
||||
)
|
||||
|
||||
io.set('origins', function (origin, req) {
|
||||
if (!origin) {
|
||||
// There is no origin or referer header - this is likely a same-site request.
|
||||
logger.warn({ req }, 'No origin or referer header')
|
||||
return true
|
||||
}
|
||||
const normalizedOrigin = URL.parse(origin).origin
|
||||
const originIsValid = allowedCorsOriginsRegex.test(normalizedOrigin)
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"lodash": "^4.17.21",
|
||||
"proxy-addr": "^2.0.7",
|
||||
"request": "^2.88.2",
|
||||
"socket.io": "github:overleaf/socket.io#0.9.19-overleaf-11",
|
||||
"socket.io": "github:overleaf/socket.io#0.9.19-overleaf-12",
|
||||
"socket.io-client": "github:overleaf/socket.io-client#0.9.17-overleaf-5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user