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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user