Skip to content

Commit

Permalink
fix: skip tag name out of utf8mb3 (#440)
Browse files Browse the repository at this point in the history
closes #438
  • Loading branch information
hezhengxu2018 authored Apr 10, 2023
1 parent 6177856 commit a64c90b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/core/service/PackageSyncerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,11 @@ export class PackageSyncerService extends AbstractService {
let shouldRefreshDistTags = false;
for (const tag in distTags) {
const version = distTags[tag];
const utf8mb3Regex = /[\u0020-\uD7FF\uE000-\uFFFD]/;
if (!utf8mb3Regex.test(tag)) {
logs.push(`[${isoNow()}] 🚧 invalid tag(${tag}: ${version}), tag name is out of utf8mb3, skip`);
continue;
}
// 新 tag 指向的版本既不在存量数据里,也不在本次同步版本列表里
// 例如 latest 对应的 version 写入失败跳过
if (!existsVersionMap[version] && !updateVersions.includes(version)) {
Expand Down

0 comments on commit a64c90b

Please sign in to comment.