Skip to content

Commit f709f42

Browse files
authored
default http to get and force uppercase (#94)
1 parent 9679867 commit f709f42

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

host.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,12 @@ func httpRequest(ctx context.Context, m api.Module, requestOffset uint64, bodyOf
518518
panic(fmt.Errorf("invalid http request: %v", err))
519519
}
520520

521+
// default method to GET and force to be upper
522+
if request.Method == "" {
523+
request.Method = "GET"
524+
}
525+
request.Method = strings.ToUpper(request.Method)
526+
521527
url, err := url.Parse(request.Url)
522528
if err != nil {
523529
panic(fmt.Errorf("invalid url: %v", err))

0 commit comments

Comments
 (0)