Skip to content

Commit c8c1328

Browse files
fix: require https for Azure AI endpoint validation
Reject non-HTTPS Azure endpoint values during backend selection to avoid sending DefaultAzureCredential bearer tokens over cleartext transport when misconfigured.
1 parent 90c8512 commit c8c1328

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

EssentialCSharp.Chat.Shared/Extensions/ServiceCollectionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ public static IServiceCollection AddConfiguredChatServices(this IServiceCollecti
115115
// Pre-validate endpoint URI to avoid exceptions in AddAzureOpenAIServices for
116116
// non-empty but invalid endpoint values.
117117
if (!Uri.TryCreate(aiOptions.Endpoint, UriKind.Absolute, out var azureUri)
118-
|| (azureUri.Scheme != Uri.UriSchemeHttp && azureUri.Scheme != Uri.UriSchemeHttps))
118+
|| azureUri.Scheme != Uri.UriSchemeHttps)
119119
{
120-
Console.Error.WriteLine("[AI] Azure endpoint is not a valid http/https URI. Falling back to local/unavailable.");
120+
Console.Error.WriteLine("[AI] Azure endpoint must be a valid https URI. Falling back to local/unavailable.");
121121
}
122122
else
123123
{

0 commit comments

Comments
 (0)