Make RestType handling case-insensitive in switch
Convert RestType to uppercase in the switch statement to ensure case-insensitive matching of REST types. This change handles variations like "get", "Get", and "GET" consistently. Additionally, use the null-conditional operator to prevent NullReferenceException when RestType is null.
This commit is contained in:
parent
9a0a37471e
commit
5b7fce8fd6
@ -26,7 +26,7 @@ public class InvokeRecActionCommandHandler(ISender sender) : IRequestHandler<Inv
|
|||||||
using var http = new HttpClient();
|
using var http = new HttpClient();
|
||||||
using var response = await http.GetAsync("https://example.com", cancel);
|
using var response = await http.GetAsync("https://example.com", cancel);
|
||||||
|
|
||||||
switch (action.RestType)
|
switch (action.RestType?.ToUpper().Trim())
|
||||||
{
|
{
|
||||||
case "GET":
|
case "GET":
|
||||||
// Handle GET
|
// Handle GET
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user