CORS support (#73)

This adds per-listener CORS support. Logic is ported from Vault, along with a fully new test suite.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-05-21 12:12:08 -04:00
1 parent 66978d637a
commit fafdcbbfa4
9 files changed
+423 -37

No files matched your search

+6 -2
View File
@@ -91,11 +91,15 @@ func WithDefaultOrgId(id string) Option {
// NewTestController blocks until a new TestController is created, returns the url for the TestController and a function
// that can be called to tear down the controller after it has been used for testing.
func NewTestController(t *testing.T, opt ...Option) (string, func()) {
func NewTestController(t *testing.T, opt ...Option) *TestController {
conf, err := getOpts(opt...)
if err != nil {
t.Fatalf("Couldn't create TestController: %v", err)
}
tc := controller.NewTestController(t, conf)
return tc.ApiAddress(), tc.Shutdown
return &TestController{TestController: tc}
}
type TestController struct {
*controller.TestController
}