From dddfab1a5e6e6952ecd2e1b8c5fe28036ebada67 Mon Sep 17 00:00:00 2001 From: Benjamin Eckel Date: Wed, 29 Jan 2025 13:46:37 -0600 Subject: [PATCH] default http to get and force uppercase --- host.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/host.go b/host.go index a32b456..8c77a9a 100644 --- a/host.go +++ b/host.go @@ -518,6 +518,12 @@ func httpRequest(ctx context.Context, m api.Module, requestOffset uint64, bodyOf panic(fmt.Errorf("invalid http request: %v", err)) } + // default method to GET and force to be upper + if (request.Method == "") { + request.Method = "GET" + } + request.Method = strings.ToUpper(request.Method) + url, err := url.Parse(request.Url) if err != nil { panic(fmt.Errorf("invalid url: %v", err))