mirror of
https://github.com/sune-org/ORP.git
synced 2026-01-14 08:38:16 +00:00
Feat: Add sune.chat to allowed origins
This commit is contained in:
2
index.js
2
index.js
@@ -26,7 +26,7 @@ export default {
|
|||||||
|
|
||||||
if (method === 'OPTIONS') return new Response(null, { status: 204, headers: CORS_HEADERS });
|
if (method === 'OPTIONS') return new Response(null, { status: 204, headers: CORS_HEADERS });
|
||||||
|
|
||||||
if ((h => h !== 'sune.planetrenox.com' && !h.endsWith('.github.io'))(new URL(req.headers.get('Origin') || 'null').hostname)) return withCORS(new Response('Forbidden', { status: 403 }));
|
if ((h => h !== 'sune.planetrenox.com' && h !== 'sune.chat' && !h.endsWith('.github.io'))(new URL(req.headers.get('Origin') || 'null').hostname)) return withCORS(new Response('Forbidden', { status: 403 }));
|
||||||
|
|
||||||
if (url.pathname === '/ws') {
|
if (url.pathname === '/ws') {
|
||||||
const isGet = method === 'GET';
|
const isGet = method === 'GET';
|
||||||
|
|||||||
Reference in New Issue
Block a user