Skip to content

Commit

Permalink
Rename option
Browse files Browse the repository at this point in the history
  • Loading branch information
cv65kr committed Nov 4, 2023
1 parent e2d7167 commit 2323e5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 2323e5c

Please sign in to comment.