Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default http to get and force uppercase #94

Merged
merged 1 commit into from
Feb 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Comment on lines +521 to +525
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed in chat. we should do this to match the behavior of js-sdk. also, we uppercase because some http servers or APIs seem to be sensitive to this.


url, err := url.Parse(request.Url)
if err != nil {
panic(fmt.Errorf("invalid url: %v", err))
Expand Down