Skip to content

Commit

Permalink
TUF target names need to be derived more intelligently
Browse files Browse the repository at this point in the history
  • Loading branch information
phenaproxima committed Oct 26, 2023
1 parent 7e76107 commit 2eee68d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/TufValidatedComposerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ private function isTufEnabled(): bool
private function getTargetFromUrl(string $url): string
{
$config = $this->getRepoConfig();
$target = str_replace($config['url'], '', $url);
if (str_starts_with($url, $config['url'])) {
$target = str_replace($config['url'], '', $url);
} else {
$target = parse_url($url, PHP_URL_PATH);
}
return urldecode(ltrim($target, '/'));
}

Expand Down

0 comments on commit 2eee68d

Please sign in to comment.