Module: sip-router
Branch: master
Commit: 067051b8c9da440566cbd09d80bb1abd424f68de
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=067051b…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Thu Oct 25 20:17:05 2012 +0100
modules/websocket: Added explicit parsing of all headers before searching for WebSocket
specific headers
---
modules/websocket/ws_handshake.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/modules/websocket/ws_handshake.c b/modules/websocket/ws_handshake.c
index bbf35fb..55dfc34 100644
--- a/modules/websocket/ws_handshake.c
+++ b/modules/websocket/ws_handshake.c
@@ -149,6 +149,14 @@ int ws_handle_handshake(struct sip_msg *msg)
return 0;
}
+ if (parse_headers(msg, HDR_EOH_F, 0) < 0)
+ {
+ LM_ERR("error parsing headers\n");
+ ws_send_reply(msg, 500, &str_status_internal_server_error,
+ NULL);
+ return 0;
+ }
+
/* Process HTTP headers */
while (hdr != NULL)
{