From f709f420a443a5a249bdd33b545bd21097f92109 Mon Sep 17 00:00:00 2001 From: Benjamin Eckel Date: Sun, 9 Feb 2025 10:05:52 -0600 Subject: [PATCH] default http to get and force uppercase (#94) --- host.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/host.go b/host.go index a32b456..c22e245 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))