Skip to content

Commit 79b5e79

Browse files
committed
fix(options): validate baseUrl to start with http
1 parent 8b6e9c7 commit 79b5e79

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/service.ts

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ export class KeycloakAdminService {
1515
public client: AdminClient;
1616

1717
constructor(options: KeycloakAdminOptions) {
18+
if (!options.config.baseUrl.startsWith('http')) {
19+
throw new Error(
20+
`Invalid base url. It should start with either http or https.`,
21+
);
22+
}
23+
1824
this.options = options;
1925
this.client = new AdminClient(options.config);
2026
this.resourceManager = new ResourceManager(this);

0 commit comments

Comments
 (0)