ISSUE-296 add CORS

This commit is contained in:
Andrea Spacca
2020-04-04 14:29:33 +02:00
parent 2dd23bff3c
commit ef28bcb28f
5 changed files with 36 additions and 1 deletions

View File

@ -207,6 +207,11 @@ var globalFlags = []cli.Flag{
Usage: "comma separated list of ips not allowed to connect to the service",
Value: "",
},
cli.StringFlag{
Name: "cors-domains",
Usage: "comma separated list of domains allowed for CORS requests",
Value: "",
},
}
type Cmd struct {
@ -245,6 +250,10 @@ func New() *Cmd {
options = append(options, server.Listener(v))
}
if v := c.String("cors-domains"); v != "" {
options = append(options, server.CorsDomains(v))
}
if v := c.String("tls-listener"); v == "" {
} else if c.Bool("tls-listener-only") {
options = append(options, server.TLSListener(v, true))