judge: fix bearer token

This commit is contained in:
undefined committed 2022-05-03 21:18:55 +08:00
1 parent 5af082eac8
commit 8ba14111db
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.18.0",
"version": "2.18.1",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+1 -1
View File
@@ -280,7 +280,7 @@ export default class Hydro {
log.info('正在连接 %sjudge/conn', this.config.server_url);
this.ws = new WebSocket(`${this.config.server_url.replace(/^http/i, 'ws')}judge/conn`, {
headers: {
Cookie: `sid=${this.config.cookie}`,
Authorization: `Bearer ${this.config.cookie.split('sid=')[1].split(';')[0]}`,
},
});
global.onDestroy.push(() => this.ws.close());