Mantis - Resin
Viewing Issue Advanced Details
5459 minor always 06-14-13 11:15 07-23-13 10:51
rickHigh  
ferg  
normal  
closed  
fixed  
none    
none 7.0.0  
0005459: Resin 7 websocket API issue
JampServlet is looking for Upgrade="WebSocket".
It should be looking for the header Upgrade="websockt"

This causes HTML 5 clients (JavaScript, Dart) to get a 404 in the Resin log when trying to call into JAMP.

It is a minor change.

@WebServlet(asyncSupported=true)
public class JampServlet extends WebSocketServletImpl
{


req.getHeader("Upgrade") is returning "websocket".

This is what the spec says it should return.

We are incorrectly expecting "WebSocket".

 

@Override
  public void service(ServletRequest request, ServletResponse response)
    throws IOException, ServletException
  {
    HttpServletRequestImpl req = (HttpServletRequestImpl) request;
    HttpServletResponseImpl res = (HttpServletResponseImpl) response;
    
    if ("WebSocket".equals(req.getHeader("Upgrade"))) {
      super.service(request, response);
      return;
    }

should be changed to

    if ("websocket".equals(req.getHeader("Upgrade"))) {
      super.service(request, response);
      return;
    }

There are no notes attached to this issue.