From 56b123c0a81527f0b0c168da116bf42321428359 Mon Sep 17 00:00:00 2001 From: rameel Date: Wed, 28 Oct 2026 23:16:51 +0500 Subject: [PATCH] tag-helpers: drop the TODO about Omit credentials for HTMX 1.9.x and 2.x HTMX 1.9.x and 2.x send requests through XMLHttpRequest, which always sends credentials to the same origin, so HtmxRequestCredentials.Omit has no equivalent there. The option stays unrendered, like every other option the target version does not support, as the docs describe. Throwing would break markup shared between HTMX versions. --- src/Ramstack.HtmxToolkit/TagHelpers/HtmxRequestTagHelper.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ramstack.HtmxToolkit/TagHelpers/HtmxRequestTagHelper.cs b/src/Ramstack.HtmxToolkit/TagHelpers/HtmxRequestTagHelper.cs index 2d7c175..c0db01d 100644 --- a/src/Ramstack.HtmxToolkit/TagHelpers/HtmxRequestTagHelper.cs +++ b/src/Ramstack.HtmxToolkit/TagHelpers/HtmxRequestTagHelper.cs @@ -272,8 +272,7 @@ internal readonly struct HtmxRequestDataPrior(HtmxRequestData data) { HtmxRequestCredentials.SameOrigin => false, HtmxRequestCredentials.Include => true, - // TODO: Consider throwing an exception when an HTMX 4-only credentials mode is configured for HTMX 1.9.x or 2.x. - // HtmxRequestCredentials.Omit => throw new InvalidOperationException(), + // XMLHttpRequest always sends credentials to the same origin, so Omit has no equivalent. _ => null };