-
-
Notifications
You must be signed in to change notification settings - Fork 754
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
Request parameters get lost on ws requests on Tomcat 7 #553
Comments
I ran into this issue, too. I use wicket-atmosphere 6.0.0-beta3 which itself uses Atmosphere 1.0.0-beta3. And I use Tomcat 7.0.29. As a workaround, I can fallback to Comet but if I could get WebSockets too, that would be great. I'm looking forward to see this ticket evolve. Regards, Pierre |
OK looking at this. Stay tuned. I've also deleted the previous comments as this is a bug in Tomcat ;-) |
Hum, I cannot reproduce the issue using the Atmosphere's Chat sample with the URL of the form of var request = { url: document.location.toString() + 'chat?test=yo',
contentType : "application/json",
logLevel : 'debug',
shared : 'true',
transport : transport ,
fallbackTransport: 'long-polling'}; which gets translated in T 127.0.0.1:54228 -> 127.0.0.1:8080 [AP]
GET /atmosphere-chat/chat?test=yo&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=1.0&X-Atmosphere-Transport=websocket&X-Cache-Date=0&Content-Type=application/json HTTP/1.1.
Upgrade: websocket.
Connection: Upgrade.
Host: 127.0.0.1:8080.
Origin: http://127.0.0.1:8080.
Sec-WebSocket-Key: 8NtGPiJuFA0ZuCbO9xxdAQ==.
Sec-WebSocket-Version: 13.
Sec-WebSocket-Extensions: x-webkit-deflate-frame.
Cookie: nikio.guid=e921455c-9487-4dbc-b5f1-ebb91d46e6e1.
. Later, in any AtmosphereHandler, I do: AtmosphereResource.getRequest().getParametersName(); and I do see them. @papegaaij or @AlienQueen , can you share a test case? |
I've created a very small demo project for wicket-atmosphere: https://github.com/papegaaij/wicket-atmosphere-quickstart . The project depends on wicket-6.0.0, which is not yet officially released, until then you can get the latest snapshots with -Dwicket.version=6.0-SNAPSHOT -Dwicket.atmosphere.version=0.3-SNAPSHOT. The difference between Tomcat and Jetty lies in HttpServletRequest.getQueryString(), as you can see in these log snippets, the query string is empty:
|
Salut, OK got it! Fixing it now. A workaround is to use the getParametersXXX, but fixing it is simple. |
With a websocket request on, for example, "scotty/app/?0-1.IBehaviorListener.0-", the query parameters are lost, causing the request to be handled as if it was "scotty/app/". This breaks wicket-atmosphere, because it needs the parameters to resolve the behavior that handles the ws requests. I'm not sure if this a bug in Tomcat or Atmosphere.
I've tried debugging the problem, but it's not clear to me how it is supposed to work. The parameters are available when AtmosphereServlet.event is called. After this method, I've stepped all the way down to CoyoteAdapter.service, which calls Request.recyle(), which clears the parameters. Next, going further down to Http11NioProtocol, TomcatWebSocketHandler.onUpgradeComplete get called, which in turn calls my servlet filter. It is passed an AtmosphereRequest that still contains the recycled Request with all parameters cleared.
The text was updated successfully, but these errors were encountered: