summaryrefslogtreecommitdiff
path: root/plugins/headers/plugin.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-21 16:08:06 +0300
committerValery Piashchynski <[email protected]>2021-01-21 16:08:06 +0300
commit8029e2d1107e4663f1104ebf25c40f252c8ea111 (patch)
tree7c9a6744fa9ce130d80c634da3d7596f70fda51a /plugins/headers/plugin.go
parent7da6c78449776e1f3c6716250bca0b712a0423a4 (diff)
Fix headers configs
Update rr.yaml Remove previous stderr messages when they were sent
Diffstat (limited to 'plugins/headers/plugin.go')
-rw-r--r--plugins/headers/plugin.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/headers/plugin.go b/plugins/headers/plugin.go
index 84194d7e..a5ee702f 100644
--- a/plugins/headers/plugin.go
+++ b/plugins/headers/plugin.go
@@ -22,7 +22,7 @@ type Plugin struct {
// misconfiguration. Services must not be used without proper configuration pushed first.
func (s *Plugin) Init(cfg config.Configurer) error {
const op = errors.Op("headers_plugin_init")
- if !cfg.Has(PluginName) {
+ if !cfg.Has(RootPluginName) {
return errors.E(op, errors.Disabled)
}
err := cfg.UnmarshalKey(RootPluginName, &s.cfg)
@@ -30,6 +30,10 @@ func (s *Plugin) Init(cfg config.Configurer) error {
return errors.E(op, errors.Disabled, err)
}
+ if s.cfg.Headers == nil {
+ return errors.E(op, errors.Disabled)
+ }
+
return nil
}