mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-06 04:14:39 +00:00
fix(github): reject malformed app URL origins
This commit is contained in:
1 parent
1adeed2a48
commit
21bd8fa2bc
3 files changed
+43
-8
No files matched your search
@@ -23,6 +23,14 @@ it('derives github api urls from html urls', function (string $htmlUrl, string $
|
||||
'github enterprise server' => ['https://github.company.internal', 'https://github.company.internal/api/v3'],
|
||||
]);
|
||||
|
||||
it('rejects malformed urls when deriving an origin', function (string $url) {
|
||||
expect(fn () => githubUrlOrigin($url))->toThrow(InvalidArgumentException::class);
|
||||
})->with([
|
||||
'blank' => [''],
|
||||
'scheme-less' => ['github.company.internal'],
|
||||
'malformed' => ['not-a-url'],
|
||||
]);
|
||||
|
||||
it('generates correct install paths for github cloud ghe cloud and ghes', function (array $attributes, string $expectedPrefix) {
|
||||
$githubApp = new GithubApp;
|
||||
$githubApp->forceFill(array_merge([
|
||||
|
||||
Reference in new issue
Block a user