Skip to content

Commit

Permalink
Fix SetAllowedOrigins
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
  • Loading branch information
rht committed Dec 1, 2015
1 parent 7670070 commit 2433100
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/http/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ func (cfg ServerConfig) AllowedOrigins() []string {
func (cfg *ServerConfig) SetAllowedOrigins(origins ...string) {
cfg.cORSOptsRWMutex.Lock()
defer cfg.cORSOptsRWMutex.Unlock()
cfg.cORSOpts.AllowedOrigins = origins
o := make([]string, len(origins))
copy(o, origins)
cfg.cORSOpts.AllowedOrigins = o
}

func (cfg *ServerConfig) AppendAllowedOrigins(origins ...string) {
Expand Down

0 comments on commit 2433100

Please sign in to comment.