From 80ac85490bb9eebb1e413e369e9400411ff7e0c3 Mon Sep 17 00:00:00 2001
From: Arne Goedeke <el@laramies.com>
Date: Thu, 7 Jan 2016 18:33:34 +0100
Subject: [PATCH] Protocols.Websocket.Request: call ::parse_request

Call ::parse_request() for WebSocket requests, too. parse_request parses
not_query and other information, which is useful to have in WebSocket
requests, aswell.
---
 lib/modules/Protocols.pmod/WebSocket.pmod | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/modules/Protocols.pmod/WebSocket.pmod b/lib/modules/Protocols.pmod/WebSocket.pmod
index 60ca881d9a..dc75c3cf62 100644
--- a/lib/modules/Protocols.pmod/WebSocket.pmod
+++ b/lib/modules/Protocols.pmod/WebSocket.pmod
@@ -442,10 +442,8 @@ class Request(function(array(string), Request:void) cb) {
     inherit Protocols.HTTP.Server.Request;
 
     protected void parse_request() {
-	if (!cb || !has_index(request_headers, "sec-websocket-key")) {
-	    ::parse_request();
-	    return;
-	} else {
+        ::parse_request();
+	if (cb && has_index(request_headers, "sec-websocket-key")) {
 	    string proto = request_headers["sec-websocket-protocol"];
 	    array(string) protocols =  proto ? proto / ", " : ({});
 #ifdef WEBSOCKET_DEBUG
-- 
GitLab