Don't panic with undefined middleware
This commit is contained in:
parent
a917115a85
commit
10acbb8d92
4 changed files with 25 additions and 8 deletions
|
@ -23,6 +23,11 @@ func (f *Builder) Build(ctx context.Context, names []string) func(*http.Response
|
|||
|
||||
for _, middleName := range names {
|
||||
if conf, ok := f.configs[middleName]; ok {
|
||||
if conf == nil || conf.Middleware == nil {
|
||||
getLogger(ctx, middleName, "undefined").Error("Invalid Middleware configuration (ResponseModifier)")
|
||||
continue
|
||||
}
|
||||
|
||||
if conf.Headers != nil {
|
||||
getLogger(ctx, middleName, "Headers").Debug("Creating Middleware (ResponseModifier)")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue