Closed rohansingh closed 2 years ago
This is a breaking change on the RequestGuard
interface, but it's also a small change that adds a lot of functionality. Use cases include:
http.RoundTripper
. We use this internally to provide a whole set of in-process services to Starlark code via an HTTP interface.Sounds fine! Simple enough of a change, and it doesn't break our own usage in a major way. LGTM
Thanks for the quick merge! :)
Update the signature of
RequestGuard.Allowed
to accept a pointer to the current Starlark thread, and to return an*http.Request
.This allows a
RequestGuard
implementation to modify the HTTP request before it is executed, and to do so on a per-thread basis if desired.