From 0d5b9700db848bb4b311c42d66dd39fe24b77d42 Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Sat, 7 Nov 2026 14:25:57 -0800 Subject: [PATCH] Web panel tests: back to invariant globalization, add lone-surrogate check Matches the shipped engine; the surrogate host discriminates the IdnHost try/catch under invariant mode. Co-Authored-By: Claude Opus 5.5 --- tools/WebPanelTests/Program.cs | 1 + tools/WebPanelTests/WebPanelTests.csproj | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/WebPanelTests/Program.cs b/tools/WebPanelTests/Program.cs index 581b485..e734733 100644 --- a/tools/WebPanelTests/Program.cs +++ b/tools/WebPanelTests/Program.cs @@ -72,6 +72,7 @@ internal static class Program Check(!WebPanelUrlPolicy.IsAllowed(u, Dw), "rejects " + u); Check(!WebPanelUrlPolicy.IsAllowed("https://www.acdreamweave.com/" + new string('a', 5000), Dw), "over MaxUrlBytes rejected"); Check(!WebPanelUrlPolicy.IsAllowed("https://www.acdreamweave.c\u2100/", Dw), "invalid IDN char fails closed (no throw)"); + Check(!WebPanelUrlPolicy.IsAllowed("https://www.acdreamweave.c" + "\uD800" + "/", Dw), "lone-surrogate host fails closed (no throw)"); } private static void Allowlist_CaseIdnTrailingDot() diff --git a/tools/WebPanelTests/WebPanelTests.csproj b/tools/WebPanelTests/WebPanelTests.csproj index 3a4bac0..1ca3121 100644 --- a/tools/WebPanelTests/WebPanelTests.csproj +++ b/tools/WebPanelTests/WebPanelTests.csproj @@ -11,8 +11,7 @@ net10.0 enable enable - - false + true WebPanelTests