summaryrefslogtreecommitdiff
path: root/plugins/headers/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/headers/plugin.go')
-rw-r--r--plugins/headers/plugin.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/headers/plugin.go b/plugins/headers/plugin.go
index 629c0f30..dc0aab5a 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")
- err := cfg.UnmarshalKey(RootPluginName, s.cfg)
+ err := cfg.UnmarshalKey(RootPluginName, &s.cfg)
if err != nil {
return errors.E(op, err)
}
@@ -48,11 +48,11 @@ func (s *Plugin) Middleware(next http.Handler) http.HandlerFunc {
if s.cfg.Headers.CORS != nil {
if r.Method == http.MethodOptions {
- s.preflightRequest(w, r)
+ s.preflightRequest(w)
return
}
- s.corsHeaders(w, r)
+ s.corsHeaders(w)
}
next.ServeHTTP(w, r)
@@ -64,7 +64,7 @@ func (s *Plugin) Name() string {
}
// configure OPTIONS response
-func (s *Plugin) preflightRequest(w http.ResponseWriter, r *http.Request) {
+func (s *Plugin) preflightRequest(w http.ResponseWriter) {
headers := w.Header()
headers.Add("Vary", "Origin")
@@ -95,7 +95,7 @@ func (s *Plugin) preflightRequest(w http.ResponseWriter, r *http.Request) {
}
// configure CORS headers
-func (s *Plugin) corsHeaders(w http.ResponseWriter, r *http.Request) {
+func (s *Plugin) corsHeaders(w http.ResponseWriter) {
headers := w.Header()
headers.Add("Vary", "Origin")