From 902cef5db68ecda6550b52b086becf1602c397c7 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 9 Feb 2012 10:01:55 -0800 Subject: [PATCH] Must only check response if readyState >= 2. --- guacamole-common-js/src/main/resources/tunnel.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guacamole-common-js/src/main/resources/tunnel.js b/guacamole-common-js/src/main/resources/tunnel.js index 618734e82..ec3e47510 100644 --- a/guacamole-common-js/src/main/resources/tunnel.js +++ b/guacamole-common-js/src/main/resources/tunnel.js @@ -223,6 +223,9 @@ Guacamole.HTTPTunnel = function(tunnelURL) { return; } + // Do not parse response yet if not ready + if (xmlhttprequest.readyState < 2) return; + // Attempt to read status var status; try { status = xmlhttprequest.status; } @@ -231,7 +234,7 @@ Guacamole.HTTPTunnel = function(tunnelURL) { catch (e) { status = 200; } // Start next request as soon as possible IF request was successful - if (xmlhttprequest.readyState >= 2 && nextRequest == null && status == 200) + if (nextRequest == null && status == 200) nextRequest = makeRequest(); // Parse stream when data is received and when complete.