Firefox send more then Upgrade in Connection header
This commit is contained in:
Markus Sattler
2015-07-15 10:09:07 +02:00
parent 28b7619419
commit cf3ca5fde2
2 changed files with 6 additions and 3 deletions

View File

@ -402,8 +402,11 @@ void WebSocketsServer::handleHeader(WSclient_t * client) {
if(headerLine.startsWith("GET ")) { if(headerLine.startsWith("GET ")) {
// cut URL out // cut URL out
client->cUrl = headerLine.substring(4, headerLine.indexOf(' ', 4)); client->cUrl = headerLine.substring(4, headerLine.indexOf(' ', 4));
} else if(headerLine == "Connection: Upgrade") { } else if(headerLine.startsWith("Connection: ")) {
client->cIsUpgrade = true; // 12 = lenght of "Connection: "
if(headerLine.indexOf("Upgrade", 12)) {
client->cIsUpgrade = true;
}
} else if(headerLine.startsWith("Upgrade: ")) { } else if(headerLine.startsWith("Upgrade: ")) {
// 9 = lenght of "Upgrade: " // 9 = lenght of "Upgrade: "
String low = headerLine.substring(9); String low = headerLine.substring(9);

View File

@ -2,7 +2,7 @@
<head> <head>
<script> <script>
var connection = new WebSocket('ws://10.11.2.1:81/test', ['arduino']); var connection = new WebSocket('ws://10.11.2.2:81/test', ['arduino']);
connection.onopen = function () { connection.onopen = function () {
connection.send('Message from Browser to ESP8266 yay its Working!! ' + new Date()); connection.send('Message from Browser to ESP8266 yay its Working!! ' + new Date());