Skip to content

add BeegoInput.RequestBody source to Beego framework #10709

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

Merged
merged 4 commits into from
Oct 6, 2022

Conversation

gregxsunday
Copy link
Contributor

The Controller.Context.BeegoInput.RequestBody source is not currently modelled. It seems like a go-to way to access a JSON request body using this framework.

Looks to me, like it's the only field in the class worth modelling:
https://pkg.go.dev/github.com/beego/beego/v2/server/web/context#BeegoInput

Here are examples of how this is used in practice:
https://cs.github.com/?q=Input.RequestBody%20language%3AGo&scopeName=All%20repos&scope=

Unfortunately, I also added import of encoding/json to the test file shifted lines thus all of the .expected files changed as well. Perhaps we could force a test without adding the import but I've not encountered using the ctx.Input.RequestBody in a different context than json.Unmarshall.

Originally, I submitted this to codeql-go repo: github/codeql-go#751

@smowton
Copy link
Contributor

smowton commented Oct 6, 2022

I've pushed commits to add a change-note for this and autoformat your test file with gofmt.

@smowton smowton merged commit 28fa06a into github:main Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants