Fixed wrong content length for websocket handshake messages

This commit is contained in:
Trustin Lee 2010-06-22 07:01:47 +00:00
parent e0545ba583
commit 7df28adfe3

View File

@ -631,14 +631,14 @@ public class HttpHeaders {
if (HttpMethod.GET.equals(req.getMethod()) &&
req.containsHeader(Names.SEC_WEBSOCKET_KEY1) &&
req.containsHeader(Names.SEC_WEBSOCKET_KEY2)) {
return 10;
return 8;
}
} else if (message instanceof HttpResponse) {
HttpResponse res = (HttpResponse) message;
if (res.getStatus().getCode() == 101 &&
res.containsHeader(Names.SEC_WEBSOCKET_ORIGIN) &&
res.containsHeader(Names.SEC_WEBSOCKET_LOCATION)) {
return 18;
return 16;
}
}