server: 修改鉴权请求头字段,去掉下划线
This commit is contained in:
@@ -40,7 +40,10 @@ io.use((socket, next) => {
|
||||
if (!appCode || appCode !== auth.appCode) {
|
||||
return next(Error("认证失败"));
|
||||
}
|
||||
if (textSHA1(auth.passphrase) !== config.appAuthHash[appName]) {
|
||||
if (
|
||||
config.appAuthHash[appName] &&
|
||||
textSHA1(auth.passphrase) !== config.appAuthHash[appName]
|
||||
) {
|
||||
return next(Error("口令错误"));
|
||||
}
|
||||
if (activeSessions.has(socket.handshake.auth.sessionID)) {
|
||||
@@ -268,7 +271,7 @@ router.get("/session/:sessionID/media/:composedID/:filename", (ctx, next) => {
|
||||
|
||||
/** 上传文件 */
|
||||
router.post("/upload_file", async (ctx, next) => {
|
||||
if (!activeSessions.has(ctx.request.headers.session_id)) {
|
||||
if (!activeSessions.has(ctx.request.headers['sid'])) {
|
||||
ctx.throw(401);
|
||||
}
|
||||
const filename = dayjs().format("YYYYMMDD_") + String(Math.random()).slice(2);
|
||||
|
||||
Reference in New Issue
Block a user