mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
ops: don't allow no origin
This commit is contained in:
parent
39c7df9bb5
commit
df42d433c9
@ -359,6 +359,12 @@ class WebServerService extends BaseService {
|
||||
req.connection?.remoteAddress,
|
||||
};
|
||||
await svc_event.emit('ip.validate', event);
|
||||
|
||||
// check if no origin
|
||||
if ( req.method === 'POST' && req.headers.origin === undefined ) {
|
||||
event.allow = false;
|
||||
}
|
||||
|
||||
if ( ! event.allow ) {
|
||||
return res.status(403).send('Forbidden');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user