-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bypass VRaptor filter in WebSocket requests. #891
Conversation
2. Creation of a unit test for the Websocket request bypass mechanism.
Garcia, please take a look at this new version of the code. I also provided a unit test along with the implementation. As an enhancement, I changed the comparison logic from equals() to contains() as the Websocket spec states that:
|
@@ -104,7 +104,13 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) | |||
|
|||
final HttpServletRequest baseRequest = (HttpServletRequest) req; | |||
final HttpServletResponse baseResponse = (HttpServletResponse) res; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you have isWebsocketRequest
you don't need the comment because the method name already did what's happening.
I think that both the code and the test look much better now. Please advise. |
It sounds nice to me. Thanks @marcioferlan. |
Bypass VRaptor filter in WebSocket requests.
When you try to open a WebSocket connection to a @serverendpoint component in your application, the current implementation of the VRaptor filter prevents it from completing.
This fix allows WebSocket requests to bypass the VRaptor filter, hence, succeeding to establish the connection.