diff --git a/src/Ramstack.HtmxToolkit/Configuration/HtmxHttpVerb.cs b/src/Ramstack.HtmxToolkit/Configuration/HtmxHttpVerb.cs index 65088f2..48d5366 100644 --- a/src/Ramstack.HtmxToolkit/Configuration/HtmxHttpVerb.cs +++ b/src/Ramstack.HtmxToolkit/Configuration/HtmxHttpVerb.cs @@ -3,6 +3,14 @@ namespace Ramstack.HtmxToolkit.Configuration; /// /// Defines the HTTP methods that can be used in HTMX configuration. /// +/// +/// +/// HEAD and OPTIONS have no hx-* attribute and are available only through htmx.ajax. +/// +/// +/// There are no members for CONNECT and TRACE, because browsers do not allow requests with these methods. +/// +/// public enum HtmxHttpVerb { /// @@ -32,24 +40,12 @@ public enum HtmxHttpVerb /// Delete, - /// - /// The CONNECT method establishes a tunnel to the server - /// identified by the target resource. - /// - Connect, - /// /// The OPTIONS method describes the communication options /// for the target resource. /// Options, - /// - /// The TRACE method performs a message loop-back test - /// along the path to the target resource. - /// - Trace, - /// /// The PATCH method applies partial modifications to a resource. /// diff --git a/src/Ramstack.HtmxToolkit/Internal/EnumHelper.cs b/src/Ramstack.HtmxToolkit/Internal/EnumHelper.cs index 9179602..a7f5d9c 100644 --- a/src/Ramstack.HtmxToolkit/Internal/EnumHelper.cs +++ b/src/Ramstack.HtmxToolkit/Internal/EnumHelper.cs @@ -116,9 +116,7 @@ or HtmxHttpVerb.Head or HtmxHttpVerb.Post or HtmxHttpVerb.Put or HtmxHttpVerb.Delete - or HtmxHttpVerb.Connect or HtmxHttpVerb.Options - or HtmxHttpVerb.Trace or HtmxHttpVerb.Patch); return value switch @@ -128,9 +126,7 @@ or HtmxHttpVerb.Trace HtmxHttpVerb.Post => "post", HtmxHttpVerb.Put => "put", HtmxHttpVerb.Delete => "delete", - HtmxHttpVerb.Connect => "connect", HtmxHttpVerb.Options => "options", - HtmxHttpVerb.Trace => "trace", _ => "patch" }; } diff --git a/tests/Ramstack.HtmxToolkit.Tests/Internal/EnumHelperTests.cs b/tests/Ramstack.HtmxToolkit.Tests/Internal/EnumHelperTests.cs index e764bcb..be6342f 100644 --- a/tests/Ramstack.HtmxToolkit.Tests/Internal/EnumHelperTests.cs +++ b/tests/Ramstack.HtmxToolkit.Tests/Internal/EnumHelperTests.cs @@ -83,9 +83,7 @@ public void ParseHtmxSwap_ReturnsNull_WithoutStyle(string? expression) => [TestCase(HtmxHttpVerb.Post, "post")] [TestCase(HtmxHttpVerb.Put, "put")] [TestCase(HtmxHttpVerb.Delete, "delete")] - [TestCase(HtmxHttpVerb.Connect, "connect")] [TestCase(HtmxHttpVerb.Options, "options")] - [TestCase(HtmxHttpVerb.Trace, "trace")] [TestCase(HtmxHttpVerb.Patch, "patch")] public void GetHttpVerbValue_ReturnsExpectedString(HtmxHttpVerb value, string expected) => Assert.That(value.GetHttpVerbValue(), Is.EqualTo(expected));