Implement api/server/cors (#1294)

This commit is contained in:
ben-toogood
2020-03-04 11:40:53 +00:00
committed by GitHub
parent 6a9001bdb1
commit 6d803d9e45
3 changed files with 58 additions and 1 deletions

View File

@@ -10,12 +10,19 @@ type Option func(o *Options)
type Options struct {
EnableACME bool
EnableCORS bool
ACMEProvider acme.Provider
EnableTLS bool
ACMEHosts []string
TLSConfig *tls.Config
}
func EnableCORS(b bool) Option {
return func(o *Options) {
o.EnableCORS = b
}
}
func EnableACME(b bool) Option {
return func(o *Options) {
o.EnableACME = b