From 50aa751dcefc0ab0e96594a5f111ead316a34a70 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Fri, 30 Apr 2021 11:44:07 +0300 Subject: - Update Lister implementation Signed-off-by: Valery Piashchynski --- plugins/headers/plugin.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'plugins/headers') diff --git a/plugins/headers/plugin.go b/plugins/headers/plugin.go index dea0d127..caba6aeb 100644 --- a/plugins/headers/plugin.go +++ b/plugins/headers/plugin.go @@ -8,11 +8,11 @@ import ( "github.com/spiral/roadrunner/v2/plugins/config" ) -// ID contains default service name. +// PluginName contains default service name. const PluginName = "headers" const RootPluginName = "http" -// Service serves headers files. Potentially convert into middleware? +// Plugin serves headers files. Potentially convert into middleware? type Plugin struct { // server configuration (location, forbidden files and etc) cfg *Config @@ -37,7 +37,7 @@ func (s *Plugin) Init(cfg config.Configurer) error { return nil } -// middleware must return true if request/response pair is handled within the middleware. +// Middleware is HTTP plugin middleware to serve headers func (s *Plugin) Middleware(next http.Handler) http.Handler { // Define the http.HandlerFunc return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -69,6 +69,11 @@ func (s *Plugin) Name() string { return PluginName } +// Available interface implementation +func (s *Plugin) Available() bool { + return true +} + // configure OPTIONS response func (s *Plugin) preflightRequest(w http.ResponseWriter) { headers := w.Header() -- cgit v1.2.3