Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsm: Check that stream name is valid on AddStream // StreamInfo #717

Merged
merged 1 commit into from Apr 21, 2021

Conversation

wallyqs
Copy link
Member

@wallyqs wallyqs commented Apr 21, 2021

Signed-off-by: Waldemar Quevedo wally@synadia.com

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 86.322% when pulling 66d9b77 on wallyqs:jsm-stream-name into 2052752 on nats-io:master.

@wallyqs wallyqs merged commit 2339257 into nats-io:master Apr 21, 2021
@wallyqs wallyqs deleted the jsm-stream-name branch April 21, 2021 23:18
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would switch to this function to match server.

@@ -532,6 +532,10 @@ func (js *js) AddStream(cfg *StreamConfig, opts ...JSOpt) (*StreamInfo, error) {
return nil, ErrStreamNameRequired
}

if strings.Contains(cfg.Name, ".") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a function in the server.

func isValidName(name string) bool {
	if name == "" {
		return false
	}
	return !strings.ContainsAny(name, ".*>")
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok will open new PR to switch to that one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants