Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ValidateAspNetCoreUrls (#2466)
This pull request introduces a validation check for the `ASPNETCORE_URLS` environment variable to ensure it is in the correct format before starting the engine in the `Program` class. This change helps in preventing runtime errors due to misconfigured URLs. Key changes: * Added a new method `ValidateAspNetCoreUrls` to check the format of the `ASPNETCORE_URLS` environment variable. This method splits the environment variable by commas or semicolons and ensures each part is a valid absolute URI. * Integrated the `ValidateAspNetCoreUrls` method into the `Main` method to validate the URLs before proceeding with the engine start. If the validation fails, an error message is printed, and the application exits with an error code. ## Why make this change? The primary motivation is to return a more clear error message to the user. Closes #2465 ## What is this change? Startup validation. ## How was this tested? - [ ] Integration Tests - [ ] Unit Tests ## Sample Request(s) Valid value in END file: `ASPNETCORE_URLS="http://localhost:5000;https://localhost:5001"` Invalid value in END file: `ASPNETCORE_URLS=http://localhost:5000;https://localhost:5001` --------- Co-authored-by: Jerry Nixon <jerry.nixon@microsoft.com>
- Loading branch information