ServerPack web open: a request never prints its URL; Windows error wording

WebOpenRequest is a record, so its generated ToString printed the URL, which
can carry a one-time code. It now names the title only. The browser failure
reads "Couldn't open your browser (Windows error N)."

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daniel Wallace 2026-11-07 15:45:18 -08:00
commit 8dda4fdf96
3 changed files with 26 additions and 4 deletions

View file

@ -7,8 +7,14 @@ using System.Collections.Generic;
namespace RynthCore.Plugin.ServerPack;
/// <summary>A page to open. The URL comes from constants in the plugin, never from chat.</summary>
internal sealed record WebOpenRequest(string Url, IReadOnlyList<string> AllowedHosts, string ProfileKey, string Title);
/// <summary>
/// A page to open. The URL comes from constants in the plugin, never from chat, but it may carry a
/// one-time code, so ToString names the title only (a record's generated ToString would print the URL).
/// </summary>
internal sealed record WebOpenRequest(string Url, IReadOnlyList<string> AllowedHosts, string ProfileKey, string Title)
{
public override string ToString() => "WebOpenRequest(" + Title + ")";
}
internal enum WebOpenRoute { Panel, Browser, Refused }