summaryrefslogtreecommitdiff
path: root/service/http/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/http/config.go')
-rw-r--r--service/http/config.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/service/http/config.go b/service/http/config.go
index 5454f124..2b8cf049 100644
--- a/service/http/config.go
+++ b/service/http/config.go
@@ -33,10 +33,26 @@ type Config struct {
// HTTP2 configuration
HTTP2 *HTTP2Config
+ // Middlewares
+ Middlewares *MiddlewaresConfig
+
// Workers configures rr server and worker pool.
Workers *roadrunner.ServerConfig
}
+type MiddlewaresConfig struct {
+ Headers *HeaderMiddlewareConfig
+}
+
+type HeaderMiddlewareConfig struct {
+ CustomRequestHeaders map[string]string
+ CustomResponseHeaders map[string]string
+}
+
+func (c *MiddlewaresConfig) EnableHeaders() bool {
+ return c.Headers.CustomRequestHeaders != nil || c.Headers.CustomResponseHeaders != nil
+}
+
type FCGIConfig struct {
// Port and port to handle as http server.
Address string
@@ -73,6 +89,10 @@ func (c *Config) EnableHTTP() bool {
return c.Address != ""
}
+func (c *Config) EnableMiddlewares() bool {
+ return c.Middlewares != nil
+}
+
// EnableTLS returns true if rr must listen TLS connections.
func (c *Config) EnableTLS() bool {
return c.SSL.Key != "" || c.SSL.Cert != ""