Add test to valid the baseURL
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
import { Config } from '@backstage/config';
|
||||
import { trimEnd } from 'lodash';
|
||||
import { isValidHost } from '../helpers';
|
||||
import { isValidHost, isValidUrl } from '../helpers';
|
||||
|
||||
/**
|
||||
* The configuration for a single Gitea integration.
|
||||
@@ -62,6 +62,10 @@ export function readGiteaConfig(config: Config): GiteaIntegrationConfig {
|
||||
throw new Error(
|
||||
`Invalid Gitea integration config, '${host}' is not a valid host`,
|
||||
);
|
||||
} else if (baseUrl && !isValidUrl(baseUrl)) {
|
||||
throw new Error(
|
||||
`Invalid Gitea integration config, '${baseUrl}' is not a valid baseUrl`,
|
||||
);
|
||||
}
|
||||
|
||||
if (baseUrl) {
|
||||
|
||||
Reference in New Issue
Block a user