Skip to content

Commit

Permalink
Added validation around CustomEnvironment Url (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
whuman authored Feb 10, 2024
1 parent daf6132 commit 9bcca64
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ProjectManagerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ public static ProjectManagerClient WithEnvironment(string env, HttpClientHandler
/// <returns>The API client to use</returns>
public static ProjectManagerClient WithCustomEnvironment(string url, HttpClientHandler clientHandler = null)
{
if (!url.StartsWith("https://"))
{
throw new InvalidOperationException("Invalid custom environment url. Please ensure the environment url starts with 'https://'");
}

return new ProjectManagerClient(url, clientHandler);
}

Expand Down

0 comments on commit 9bcca64

Please sign in to comment.