respToken will return the last token of a literal response inbox which we use for the message channel lookup. This needs to verify the subject prefix matches to protect itself against the server changing the subject. Lock should be held.
(respInbox string)
| 4780 | // prefix matches to protect itself against the server changing the subject. |
| 4781 | // Lock should be held. |
| 4782 | func (nc *Conn) respToken(respInbox string) string { |
| 4783 | if token, found := strings.CutPrefix(respInbox, nc.respSubPrefix); found { |
| 4784 | return token |
| 4785 | } |
| 4786 | return "" |
| 4787 | } |
| 4788 | |
| 4789 | // Subscribe will express interest in the given subject. The subject |
| 4790 | // can have wildcards. |