mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: allow websocket server without auth
This commit is contained in:
1 parent
86ead663df
commit
fda667c424
2 files changed
+3
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.3.6",
|
||||
"version": "3.3.7",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -868,6 +868,7 @@ export function Connection(
|
||||
const args = { domainId: 'system', ...h.request.params };
|
||||
h.args = args;
|
||||
h.domainId = args.domainId;
|
||||
if (!h.noAuth) {
|
||||
const cookie = await new Promise((r) => {
|
||||
conn.once('data', r);
|
||||
});
|
||||
@@ -875,6 +876,7 @@ export function Connection(
|
||||
await h.init(args);
|
||||
conn.write(JSON.stringify({ event: 'auth' }));
|
||||
checker.call(h);
|
||||
}
|
||||
|
||||
if (h._prepare) await h._prepare(args);
|
||||
if (h.prepare) await h.prepare(args);
|
||||
|
||||
Reference in new issue
Block a user