[Spice-devel] [PATCH spice-server 19/30] Assure HTTP header is proper terminated

Frediano Ziglio fziglio at redhat.com
Mon Nov 21 12:52:06 UTC 2016


HTTP header end with 2 end of lines.
---
 server/websocket.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/websocket.c b/server/websocket.c
index fd2dbb2..1f6151c 100644
--- a/server/websocket.c
+++ b/server/websocket.c
@@ -473,8 +473,9 @@ static bool websocket_is_start(gchar *buf)
             // TODO strip, do not assume a single space
             find_str(buf, "\nSec-WebSocket-Protocol: binary") &&
             find_str(buf, "\nSec-WebSocket-Key:") &&
-            g_str_has_suffix(buf, "\r\n"))
+            g_str_has_suffix(buf, "\r\n\r\n")) {
         return TRUE;
+    }
 
     return FALSE;
 }
-- 
2.7.4



More information about the Spice-devel mailing list