mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix storage sign
This commit is contained in:
11 files changed
+41
-28
No files matched your search
@@ -370,8 +370,10 @@ class LocalStorageService {
|
||||
}
|
||||
|
||||
async isLinkValid(link: string) {
|
||||
const [target, expire, secret] = link.split('/');
|
||||
const expected = md5(`${target}/${expire}/${this.config.secret}`);
|
||||
const parts = link.split('/');
|
||||
const secret = parts.pop();
|
||||
parts.push(this.config.secret);
|
||||
const expected = md5(parts.join('/'));
|
||||
return expected === secret;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user