File: 0008-sec-websocket-protocol.patch

package info (click to toggle)
rabbitmq-server 3.3.5-1.1
  • links: PTS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 12,004 kB
  • sloc: erlang: 78,203; python: 3,187; xml: 2,843; makefile: 903; sh: 831; java: 660; perl: 64; ruby: 63
file content (16 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/cowboy_http_req.erl b/src/cowboy_http_req.erl
index 92d96ad..dd772df 100644
--- a/src/cowboy_http_req.erl
+++ b/src/cowboy_http_req.erl
@@ -288,6 +282,11 @@ parse_header(Name, Req, Default) when Name =:= 'Upgrade' ->
 		fun (Value) ->
 			cowboy_http:nonempty_list(Value, fun cowboy_http:token_ci/2)
 		end);
+parse_header(Name, Req, Default) when Name =:= <<"sec-websocket-protocol">> ->
+    parse_header(Name, Req, Default,
+        fun (Value) ->
+            cowboy_http:nonempty_list(Value, fun cowboy_http:token/2)
+        end);
 parse_header(Name, Req, Default) ->
 	{Value, Req2} = header(Name, Req, Default),
 	{undefined, Value, Req2}.