1
0
Fork 0

Merge remote-tracking branch 'upstream/v2.2' into mrg-current-v2.2

This commit is contained in:
jb doumenjou 2020-07-10 10:46:11 +02:00
commit 73ca7ad0c1
156 changed files with 1768 additions and 892 deletions

View file

@ -19,6 +19,7 @@ type Builder struct {
}
// Build Builds the response modifier.
// It returns nil if there is no modifier to apply.
func (f *Builder) Build(ctx context.Context, names []string) func(*http.Response) error {
var modifiers []func(*http.Response) error
@ -44,7 +45,10 @@ func (f *Builder) Build(ctx context.Context, names []string) func(*http.Response
for _, name := range conf.Chain.Middlewares {
qualifiedNames = append(qualifiedNames, provider.GetQualifiedName(chainCtx, name))
}
modifiers = append(modifiers, f.Build(ctx, qualifiedNames))
if rm := f.Build(ctx, qualifiedNames); rm != nil {
modifiers = append(modifiers, rm)
}
}
}
@ -60,5 +64,5 @@ func (f *Builder) Build(ctx context.Context, names []string) func(*http.Response
}
}
return func(response *http.Response) error { return nil }
return nil
}