From baec0b33f74a225983e122c545c55f5a76b6deed Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Fri, 22 May 2026 17:26:56 -0400 Subject: [PATCH] Fix QR scan stripping scheme from product URL LookupAsync builds SpecPageUrl from the ProductUrlTemplate via TryBuildDirectUrl. If the template is stored without a scheme the link is scheme-less and browsers treat it as relative, appending it to the app URL. The scanned QR URL is always fully-qualified and always the correct product page (it came from the manufacturer's bag), so use it unconditionally as SpecPageUrl on the pattern-matched QR path instead of only when SpecPageUrl was null. Co-Authored-By: Claude Sonnet 4.6 --- src/PowderCoating.Web/Controllers/InventoryController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PowderCoating.Web/Controllers/InventoryController.cs b/src/PowderCoating.Web/Controllers/InventoryController.cs index 3ae5d49..a703431 100644 --- a/src/PowderCoating.Web/Controllers/InventoryController.cs +++ b/src/PowderCoating.Web/Controllers/InventoryController.cs @@ -946,7 +946,10 @@ public class InventoryController : Controller if (!string.IsNullOrWhiteSpace(urlMfr)) { aiResult = await _aiLookupService.LookupAsync(urlMfr, urlColor, null, urlPart); - if (aiResult.Success && aiResult.SpecPageUrl == null) + // The scanned QR URL is always the authoritative product page link — it came + // directly from the manufacturer's bag and is always fully-qualified. Overwrite + // whatever LookupAsync returned (which may be a scheme-less path from the template). + if (aiResult.Success) aiResult.SpecPageUrl = qrUrl; } else