1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 17:03:58 +08:00

Fix SetAllowedOrigins

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
This commit is contained in:
rht
2015-12-01 18:44:17 +07:00
parent 89a6f01be0
commit b9706815b3

View File

@ -332,7 +332,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) {