mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-13 22:48:31 -05:00
Fix redos vulnerability
This commit is contained in:
parent
d12a6fdb1e
commit
77c67e674b
1 changed files with 1 additions and 1 deletions
|
@ -8,7 +8,7 @@ import { URL } from 'url';
|
||||||
* @returns {String}
|
* @returns {String}
|
||||||
*/
|
*/
|
||||||
export function getVersionFromTarball(fileName: string): string | void {
|
export function getVersionFromTarball(fileName: string): string | void {
|
||||||
const groups = fileName.match(/^.+-(\d+\.\d+\.\d+.+)\.tgz$/);
|
const groups = fileName.replace(/\.tgz$/, '').match(/^[^/]+-(\d+\.\d+\.\d+.*)/);
|
||||||
|
|
||||||
return groups !== null ? groups[1] : undefined;
|
return groups !== null ? groups[1] : undefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue