Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -960,10 +960,10 @@ internal static async Task ExecuteMessagingEndpointStepAsync(SetupContext ctx)
/// Prompts for the messaging endpoint URL. Returns the entered HTTPS URL, or null to defer
/// (blank entry). The caller prints the section header and opens the indent scope.
/// </summary>
private static async Task<string?> PromptForMessagingEndpointAsync(SetupContext ctx)
private static Task<string?> PromptForMessagingEndpointAsync(SetupContext ctx)
{
if (ctx.NonInteractive)
return null;
return Task.FromResult<string?>(null);

ctx.Logger.LogInformation("The HTTPS URL where your deployed agent receives messages.");
ctx.Logger.LogInformation("Leave blank to configure it later, after you deploy the agent.");
Expand All @@ -975,15 +975,15 @@ internal static async Task ExecuteMessagingEndpointStepAsync(SetupContext ctx)
var entered = ConsoleHelper.ReadLineCancellable(ctx.CancellationToken)?.Trim();

if (string.IsNullOrWhiteSpace(entered))
return null;
return Task.FromResult<string?>(null);

if (Uri.TryCreate(entered, UriKind.Absolute, out var uri) && uri.Scheme == Uri.UriSchemeHttps)
return entered;
return Task.FromResult<string?>(entered);

ctx.Logger.LogWarning("Enter a valid HTTPS URL (e.g. https://my-agent.example.com/api/messages), or leave blank to skip.");
}

return null;
return Task.FromResult<string?>(null);
}

/// <summary>
Expand Down
Loading