summaryrefslogtreecommitdiff
path: root/plugins/headers/config.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-26 00:40:31 +0300
committerValery Piashchynski <[email protected]>2020-12-26 00:40:31 +0300
commit7a0dee1a416705c621edbf50e1f43fb39845348f (patch)
tree0007a6b8c8ac9e7d31b8a5f3f7f27669c860d261 /plugins/headers/config.go
parent8526c03822e724bc2ebb64b6197085fea335b782 (diff)
Huge tests refactoring. Reduce running time 2-3x times
Diffstat (limited to 'plugins/headers/config.go')
-rw-r--r--plugins/headers/config.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/headers/config.go b/plugins/headers/config.go
new file mode 100644
index 00000000..8d4e29c2
--- /dev/null
+++ b/plugins/headers/config.go
@@ -0,0 +1,36 @@
+package headers
+
+// Config declares headers service configuration.
+type Config struct {
+ Headers 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
+}