mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Adds the same check for valid stream name for Mirror
Fix test using invalid stream names Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
This commit is contained in:
@@ -1164,6 +1164,9 @@ func (s *Server) checkStreamCfg(config *StreamConfig, acc *Account) (StreamConfi
|
||||
// Do not perform checks if External is provided, as it could lead to
|
||||
// checking against itself (if sourced stream name is the same on different JetStream)
|
||||
if cfg.Mirror.External == nil {
|
||||
if !isValidName(cfg.Mirror.Name) {
|
||||
return StreamConfig{}, NewJSMirrorInvalidStreamNameError()
|
||||
}
|
||||
// We do not require other stream to exist anymore, but if we can see it check payloads.
|
||||
exists, maxMsgSize, subs := hasStream(cfg.Mirror.Name)
|
||||
if len(subs) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user