mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-15 02:30:40 -07:00
@@ -209,7 +209,7 @@ func (s *Server) enableJetStream(cfg JetStreamConfig) error {
|
||||
s.Noticef(" Max Storage: %s", friendlyBytes(cfg.MaxStore))
|
||||
s.Noticef(" Store Directory: \"%s\"", cfg.StoreDir)
|
||||
if cfg.Domain != _EMPTY_ {
|
||||
s.Noticef(" Enable Domain: %s", cfg.Domain)
|
||||
s.Noticef(" Domain: %s", cfg.Domain)
|
||||
}
|
||||
s.Noticef("-------------------------------------------")
|
||||
|
||||
@@ -1949,6 +1949,10 @@ func validateJetStreamOptions(o *Options) error {
|
||||
if subj := fmt.Sprintf(jsDomainAPI, o.JetStreamDomain); !IsValidSubject(subj) {
|
||||
return fmt.Errorf("invalid domain name: derived %q is not a valid subject", subj)
|
||||
}
|
||||
|
||||
if !isValidName(o.JetStreamDomain) {
|
||||
return fmt.Errorf("invalid domain name: may not contain ., * or >")
|
||||
}
|
||||
}
|
||||
// If not clustered no checks needed past here.
|
||||
if !o.JetStream || o.Cluster.Port == 0 {
|
||||
|
||||
@@ -11225,6 +11225,7 @@ func TestJetStreamServerDomainBadConfig(t *testing.T) {
|
||||
shouldFail("CORE.")
|
||||
shouldFail(".CORE")
|
||||
shouldFail("C.*.O. RE")
|
||||
shouldFail("C.ORE")
|
||||
}
|
||||
|
||||
func TestJetStreamServerDomainConfig(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user