Skip to content

Commit

Permalink
default http to get and force uppercase (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhelx authored Feb 9, 2025
1 parent 9679867 commit f709f42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions host.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit f709f42

Please sign in to comment.