diff --git a/dist/index.js b/dist/index.js index 664c9404..234c64a2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1177,7 +1177,7 @@ async function customPackage(pkg, type, version, os_version) { } exports.customPackage = customPackage; async function parseExtensionSource(extension, prefix) { - const regex = /(\w+)-(.+:\/\/.+(?:[.:].+)+\/)?([\w.-]+)\/([\w.-]+)@(.+)/; + const regex = /(\w+)-(\w+:\/\/.{1,253}(?:[.:][^:/\s]{2,63})+\/)?([\w.-]+)\/([\w.-]+)@(.+)/; const matches = regex.exec(extension); matches[2] = matches[2] ? matches[2].slice(0, -1) : 'https://github.com'; return await joins('\nadd_extension_from_source', ...matches.splice(1, matches.length), prefix); diff --git a/src/utils.ts b/src/utils.ts index ab9579f7..1692fbc2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -492,7 +492,8 @@ export async function parseExtensionSource( prefix: string ): Promise { // Groups: extension, domain url, org, repo, release - const regex = /(\w+)-(.+:\/\/.+(?:[.:].+)+\/)?([\w.-]+)\/([\w.-]+)@(.+)/; + const regex = + /(\w+)-(\w+:\/\/.{1,253}(?:[.:][^:/\s]{2,63})+\/)?([\w.-]+)\/([\w.-]+)@(.+)/; const matches = regex.exec(extension) as RegExpExecArray; matches[2] = matches[2] ? matches[2].slice(0, -1) : 'https://github.com'; return await joins(