StompProtocolAndroid
StompProtocolAndroid copied to clipboard
Changed header pattern
According to the STOMP protocol specification 1.2; each header should be terminated with an EOL. Currently, the regex for headers stops if it sees a :
. This pull request fixes the regex.
An example of a message that the current implementation can't handle is shown below:
ERROR
message:Failed to send message to ExecutorSubscribableChannel[clientInboundChannel]; nested exception is org.springframework.security.access.AccessDeniedException\c Access is denied
content-length:0
The regex currently includes a colon in the middle to address standard headers like the example you gave:
([^:\s]+)\s*:\s*([^:\s]+)
Yes, and that is fine. The issue is the second group. Please see the following link, with the original regex and the body given in the example : regexr.com/5crbl. There you'll notice, that only the first word is recognized. What this PR does, is to capture the second group fully, by only terminating on a newline, instead of a colon.
Ahh I understand. :+1:
The PR now only includes the header change
Can someone merge this and release a new version please?
@NaikSoftware this issue is still present. Would you be so kind to review and merge this branch?