Allow CORS requests from localhost for development (#104385)
Allow CORS requests from `http://localhost:<port>`. Some webbrowsers (like Safari) are picky about hostname vs. IP addresses, and this makes them work well with the webapp development server. Reviewed-on: https://projects.blender.org/studio/flamenco/pulls/104385 Reviewed-by: Sybren A. Stüvel <sybren@blender.org>
This commit is contained in:
parent
d2bdc9690d
commit
84e4a28d6c
@ -244,6 +244,7 @@ func corsOrigins(urls []url.URL) []string {
|
||||
url.Host = fmt.Sprintf("%s:%d", url.Hostname(), developmentWebInterfacePort)
|
||||
origins[i] = url.String()
|
||||
}
|
||||
origins = append(origins, fmt.Sprintf("http://localhost:%d", developmentWebInterfacePort))
|
||||
log.Debug().Str("origins", strings.Join(origins, " ")).Msg("acceptable CORS origins")
|
||||
return origins
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user