embed: rename "Config.CorsInfo" to "Config.CORS"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>release-3.4
parent
c841de1f62
commit
c7cecca575
|
@ -169,7 +169,7 @@ type Config struct {
|
||||||
PeerTLSInfo transport.TLSInfo
|
PeerTLSInfo transport.TLSInfo
|
||||||
PeerAutoTLS bool
|
PeerAutoTLS bool
|
||||||
|
|
||||||
CorsInfo map[string]struct{}
|
CORS map[string]struct{}
|
||||||
|
|
||||||
// HostWhitelist lists acceptable hostnames from HTTP client requests.
|
// HostWhitelist lists acceptable hostnames from HTTP client requests.
|
||||||
// Client origin policy protects against "DNS Rebinding" attacks
|
// Client origin policy protects against "DNS Rebinding" attacks
|
||||||
|
@ -242,7 +242,7 @@ type configJSON struct {
|
||||||
APUrlsJSON string `json:"initial-advertise-peer-urls"`
|
APUrlsJSON string `json:"initial-advertise-peer-urls"`
|
||||||
ACUrlsJSON string `json:"advertise-client-urls"`
|
ACUrlsJSON string `json:"advertise-client-urls"`
|
||||||
|
|
||||||
CorsJSON string `json:"cors"`
|
CORSJSON string `json:"cors"`
|
||||||
HostWhitelistJSON string `json:"host-whitelist"`
|
HostWhitelistJSON string `json:"host-whitelist"`
|
||||||
|
|
||||||
ClientSecurityJSON securityConfig `json:"client-transport-security"`
|
ClientSecurityJSON securityConfig `json:"client-transport-security"`
|
||||||
|
@ -285,8 +285,8 @@ func NewConfig() *Config {
|
||||||
LogOutput: DefaultLogOutput,
|
LogOutput: DefaultLogOutput,
|
||||||
Metrics: "basic",
|
Metrics: "basic",
|
||||||
EnableV2: DefaultEnableV2,
|
EnableV2: DefaultEnableV2,
|
||||||
CorsInfo: make(map[string]struct{}),
|
CORS: map[string]struct{}{"*": {}},
|
||||||
HostWhitelist: make(map[string]struct{}),
|
HostWhitelist: map[string]struct{}{"*": {}},
|
||||||
AuthToken: "simple",
|
AuthToken: "simple",
|
||||||
PreVote: false, // TODO: enable by default in v3.5
|
PreVote: false, // TODO: enable by default in v3.5
|
||||||
}
|
}
|
||||||
|
@ -408,9 +408,9 @@ func (cfg *configYAML) configFromFile(path string) error {
|
||||||
cfg.ListenMetricsUrls = []url.URL(u)
|
cfg.ListenMetricsUrls = []url.URL(u)
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.CorsJSON != "" {
|
if cfg.CORSJSON != "" {
|
||||||
uv := flags.NewUniqueURLsWithExceptions(cfg.HostWhitelistJSON, "*")
|
uv := flags.NewUniqueURLsWithExceptions(cfg.CORSJSON, "*")
|
||||||
cfg.CorsInfo = uv.Values
|
cfg.CORS = uv.Values
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.HostWhitelistJSON != "" {
|
if cfg.HostWhitelistJSON != "" {
|
||||||
|
|
Loading…
Reference in New Issue