MCPcopy
hub / github.com/nats-io/nats.go / badSubject

Function badSubject

nats.go:4865–4876  ·  view source on GitHub ↗

badSubject will do quick test on whether a subject is acceptable. Spaces are not allowed and all tokens should be > 0 in len.

(subj string)

Source from the content-addressed store, hash-verified

4863// badSubject will do quick test on whether a subject is acceptable.
4864// Spaces are not allowed and all tokens should be > 0 in len.
4865func badSubject(subj string) bool {
4866 if strings.ContainsAny(subj, " \t\r\n") {
4867 return true
4868 }
4869 tokens := strings.Split(subj, ".")
4870 for _, t := range tokens {
4871 if len(t) == 0 {
4872 return true
4873 }
4874 }
4875 return false
4876}
4877
4878// badQueue will check a queue name for whitespace.
4879func badQueue(qname string) bool {

Callers 1

subscribeLockedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected