Skip to content

Changed header pattern - #186

Open
boginw wants to merge 2 commits into
NaikSoftware:masterfrom
boginw:master
Open

Changed header pattern#186
boginw wants to merge 2 commits into
NaikSoftware:masterfrom
boginw:master

Conversation

@boginw

Copy link
Copy Markdown

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

@forresthopkinsa

Copy link
Copy Markdown
Contributor

The regex currently includes a colon in the middle to address standard headers like the example you gave:

([^:\s]+)\s*:\s*([^:\s]+)

@boginw

Copy link
Copy Markdown
Author

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.

@forresthopkinsa

Copy link
Copy Markdown
Contributor

Ahh I understand. 👍

@forresthopkinsaforresthopkinsa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

build.gradle changes aren't necessary, but otherwise LGTM

@boginw
boginwforce-pushed the master branch 2 times, most recently from 1b803ac to 9cb5e63CompareOctober 16, 2020 15:05
@boginw

Copy link
Copy Markdown
Author

The PR now only includes the header change

@kientux

Copy link
Copy Markdown

Can someone merge this and release a new version please?

@boginw

Copy link
Copy Markdown
Author

@NaikSoftware this issue is still present. Would you be so kind to review and merge this branch?

Sign up for freeto 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.

3 participants

@boginw@forresthopkinsa@kientux