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)
| 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. |
| 4865 | func 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. |
| 4879 | func badQueue(qname string) bool { |