From 2323e5c3490f06f2a25447a0c9477aebafb4c279 Mon Sep 17 00:00:00 2001 From: Kajetan Date: Sat, 4 Nov 2023 12:40:19 +0100 Subject: [PATCH] Rename option --- config.go | 4 ++-- plugin.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.go b/config.go index 389dd5d..f4aa6ef 100644 --- a/config.go +++ b/config.go @@ -13,8 +13,8 @@ type Config struct { // CORSConfig headers configuration. type CORSConfig struct { // AllowedOrigin: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin - AllowedOrigin string `mapstructure:"allowed_origin"` - AllowedOriginWildcard string `mapstructure:"allowed_origin_wildcard"` + AllowedOrigin string `mapstructure:"allowed_origin"` + AllowedOriginRegex string `mapstructure:"allowed_origin_regex"` // AllowedHeaders: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers AllowedHeaders string `mapstructure:"allowed_headers"` // AllowedMethods: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods diff --git a/plugin.go b/plugin.go index 8495fb5..5b689e0 100644 --- a/plugin.go +++ b/plugin.go @@ -73,9 +73,9 @@ func (p *Plugin) Init(cfg Configurer) error { } // if this option is set, the content of `AllowedOrigins` is ignored - if p.cfg.CORS.AllowedOriginWildcard != "" { + if p.cfg.CORS.AllowedOriginRegex != "" { var err error - p.allowedOriginRegex, err = regexp.Compile(p.cfg.CORS.AllowedOriginWildcard) + p.allowedOriginRegex, err = regexp.Compile(p.cfg.CORS.AllowedOriginRegex) if err != nil { return errors.E(op, err) }