Skip to content
Snippets Groups Projects
Commit b9706815 authored by rht's avatar rht
Browse files

Fix SetAllowedOrigins


License: MIT
Signed-off-by: default avatarrht <rhtbot@gmail.com>
parent 89a6f01b
No related branches found
No related tags found
1 merge request!1New
...@@ -332,7 +332,9 @@ func (cfg ServerConfig) AllowedOrigins() []string { ...@@ -332,7 +332,9 @@ func (cfg ServerConfig) AllowedOrigins() []string {
func (cfg *ServerConfig) SetAllowedOrigins(origins ...string) { func (cfg *ServerConfig) SetAllowedOrigins(origins ...string) {
cfg.cORSOptsRWMutex.Lock() cfg.cORSOptsRWMutex.Lock()
defer cfg.cORSOptsRWMutex.Unlock() 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) { func (cfg *ServerConfig) AppendAllowedOrigins(origins ...string) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment