parent
22986ccb38
commit
a027a7dd65
1 changed files with 4 additions and 1 deletions
|
@ -323,7 +323,6 @@ func CopyModelHandler(c *gin.Context) {
|
|||
func Serve(ln net.Listener, extraOrigins []string) error {
|
||||
config := cors.DefaultConfig()
|
||||
config.AllowWildcard = true
|
||||
// only allow http/https from localhost
|
||||
allowedOrigins := []string{
|
||||
"http://localhost",
|
||||
"http://localhost:*",
|
||||
|
@ -333,6 +332,10 @@ func Serve(ln net.Listener, extraOrigins []string) error {
|
|||
"http://127.0.0.1:*",
|
||||
"https://127.0.0.1",
|
||||
"https://127.0.0.1:*",
|
||||
"http://0.0.0.0",
|
||||
"http://0.0.0.0:*",
|
||||
"https://0.0.0.0",
|
||||
"https://0.0.0.0:*",
|
||||
}
|
||||
allowedOrigins = append(allowedOrigins, extraOrigins...)
|
||||
config.AllowOrigins = allowedOrigins
|
||||
|
|
Loading…
Add table
Reference in a new issue