aboutsummaryrefslogtreecommitdiff
path: root/lib/play/http_example_test.go
AgeCommit message (Collapse)Author
2025-01-16lib/play: handle writing files outside the [GoOptions.Root]Shulhan
Any request to Run or Test Go code that requires writing new files will be joined with the [GoOptions.Root] first. If the final absolute path does not have Root as the prefix it will return an error [os.ErrPermission].
2025-01-16lib/play: refactor functions as methods of type GoShulhan
One of the major issue that we previously have is the Run and Test functions can write file in any unsafe path. Another issue is changing the default GoVersion and Timeout is set on the package level. This changes introduce new type Go as the top level type that can be instantiate with different Root, GoVersion, and Timeout. The instance of Go then can Format, Run, or Test the Go code in their own scope.
2024-12-28lib/play: move all HTTP related methods to its own fileShulhan
2024-12-28lib/play: implement function to test Go codeShulhan
The Test and HTTPHandleTest functions accept Request with File and Body fields.