Limit incoming request body size for all endpoints and add rate limiting wrappera round storage

This commit is contained in:
breel
2020-07-26 20:25:39 -06:00
parent c3b948556c
commit 36c4ae520d
6 changed files with 86 additions and 5 deletions

View File

@@ -23,11 +23,11 @@ func TestIntegration(t *testing.T) {
f.Close()
defer os.Remove(f.Name())
os.Setenv("DBURI", f.Name())
graph := NewGraph()
graph := NewRateLimitedGraph()
ctx, can := context.WithCancel(context.TODO())
defer can()
clean := func() {
graph.driver.Delete(context.TODO(), "col", map[string]string{})
graph.g.driver.Delete(context.TODO(), "col", map[string]string{})
}
clean()
defer clean()
@@ -42,7 +42,7 @@ func TestIntegration(t *testing.T) {
cleanFill := func() {
clean()
for i := range ones {
if err := graph.driver.Insert(context.TODO(), "col", ones[i]); err != nil {
if err := graph.g.driver.Insert(context.TODO(), "col", ones[i]); err != nil {
t.Fatal(err)
}
}