From fde41e17666a8c36eff4a327346aed3c210e03a1 Mon Sep 17 00:00:00 2001 From: Pavel Kozlov Date: Fri, 4 Jul 2014 17:15:38 +0200 Subject: [PATCH 1/2] cowboy 0.10.0 dependencies --- README.md | 1 + examples/cowboy_echo.erl | 1 + examples/cowboy_test_server.erl | 3 ++- rebar.config | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a13a45d..f2e1f43 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ main(_) -> ok = application:start(sockjs), ok = application:start(ranch), ok = application:start(crypto), + ok = application:start(cowlib), ok = application:start(cowboy), SockjsState = sockjs_handler:init_state( diff --git a/examples/cowboy_echo.erl b/examples/cowboy_echo.erl index ac18843..fd6ea45 100755 --- a/examples/cowboy_echo.erl +++ b/examples/cowboy_echo.erl @@ -15,6 +15,7 @@ main(_) -> ok = application:start(sockjs), ok = application:start(ranch), ok = application:start(crypto), + ok = application:start(cowlib), ok = application:start(cowboy), SockjsState = sockjs_handler:init_state( diff --git a/examples/cowboy_test_server.erl b/examples/cowboy_test_server.erl index c7396e5..3ecda4a 100755 --- a/examples/cowboy_test_server.erl +++ b/examples/cowboy_test_server.erl @@ -14,7 +14,8 @@ main(_) -> ok = application:start(xmerl), ok = application:start(sockjs), ok = application:start(ranch), - ok = application:start(crypto), + ok = application:start(crypto), + ok = application:start(cowlib), ok = application:start(cowboy), StateEcho = sockjs_handler:init_state( diff --git a/rebar.config b/rebar.config index 03f63bb..bca9d70 100644 --- a/rebar.config +++ b/rebar.config @@ -11,5 +11,5 @@ ]}. {deps, [ - {cowboy, "0.8.3",{git, "https://github.com/extend/cowboy.git", "0.8.3"}} + {cowboy, "0.10.0",{git, "https://github.com/extend/cowboy.git", "0.10.0"}} ]}. From 29e25c4d863bfa1d898499b35be6b31bdaedb7fa Mon Sep 17 00:00:00 2001 From: Pavel Kozlov Date: Tue, 8 Jul 2014 18:16:05 +0200 Subject: [PATCH 2/2] JSESSIONID cookie extraction fix Error in JsessionidCookie.test_xhr sockjs-protocol test Name of cookie for cowboy_req must be upper-cased --- src/sockjs_http.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sockjs_http.erl b/src/sockjs_http.erl index 5060beb..59074e0 100644 --- a/src/sockjs_http.erl +++ b/src/sockjs_http.erl @@ -70,7 +70,7 @@ header(K, {cowboy, Req})-> -spec jsessionid(req()) -> {nonempty_string() | undefined, req()}. jsessionid({cowboy, Req}) -> - {C, Req2} = cowboy_req:cookie(<<"jsessionid">>, Req), + {C, Req2} = cowboy_req:cookie(<<"JSESSIONID">>, Req), case C of _ when is_binary(C) -> {binary_to_list(C), {cowboy, Req2}};