mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-28 08:56:58 +00:00
ops: don't allow no origin
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user