added 5.0 changelog

This commit is contained in:
wukko
2023-02-13 21:56:52 +06:00
parent 7911a35eb6
commit c57d16b615
5 changed files with 15 additions and 10 deletions

View File

@@ -43,9 +43,8 @@ export function createStream(obj) {
export function verifyStream(ip, id, hmac, exp) {
try {
let streamInfo = streamCache.get(id);
if (!streamInfo) {
return { error: 'this stream token does not exist', status: 400 };
}
if (!streamInfo) return { error: 'this stream token does not exist', status: 400 };
let ghmac = sha256(`${id},${streamInfo.service},${ip},${exp}`, salt);
if (String(hmac) === ghmac && String(exp) === String(streamInfo.exp) && ghmac === String(streamInfo.hmac)
&& String(ip) === streamInfo.ip && Number(exp) > Math.floor(new Date().getTime())) {