Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e7dee98

Browse files
committedDec 1, 2015
Fix SetAllowedOrigins
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
1 parent 792da9d commit e7dee98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎commands/http/handler.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ func (cfg ServerConfig) AllowedOrigins() []string {
321321
func (cfg *ServerConfig) SetAllowedOrigins(origins ...string) {
322322
cfg.cORSOptsRWMutex.Lock()
323323
defer cfg.cORSOptsRWMutex.Unlock()
324-
cfg.cORSOpts.AllowedOrigins = origins
324+
o := make([]string, len(origins))
325+
copy(o, origins)
326+
cfg.cORSOpts.AllowedOrigins = o
325327
}
326328

327329
func (cfg *ServerConfig) AppendAllowedOrigins(origins ...string) {

0 commit comments

Comments
 (0)
Please sign in to comment.