diff options
Diffstat (limited to 'service/headers/config.go')
-rw-r--r-- | service/headers/config.go | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/service/headers/config.go b/service/headers/config.go deleted file mode 100644 index f9af1df2..00000000 --- a/service/headers/config.go +++ /dev/null @@ -1,41 +0,0 @@ -package headers - -import "github.com/spiral/roadrunner/service" - -// Config declares headers service configuration. -type Config struct { - // CORS settings. - CORS *CORSConfig - - // Request headers to add to every payload send to PHP. - Request map[string]string - - // Response headers to add to every payload generated by PHP. - Response map[string]string -} - -// CORSConfig headers configuration. -type CORSConfig struct { - // AllowedOrigin: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin - AllowedOrigin string - - // AllowedHeaders: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers - AllowedHeaders string - - // AllowedMethods: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods - AllowedMethods string - - // AllowCredentials https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials - AllowCredentials *bool - - // ExposeHeaders: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers - ExposedHeaders string - - // MaxAge of CORS headers in seconds/ - MaxAge int -} - -// Hydrate service config. -func (c *Config) Hydrate(cfg service.Config) error { - return cfg.Unmarshal(c) -} |