Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

#8 If JSESSIOND is present - echo it back.

  • Loading branch information...
commit c68a3215903a00cc0dd12bb2994ae1f923e88223 1 parent 0436c14
@majek majek authored
Showing with 8 additions and 3 deletions.
  1. +1 −1  src/sockjs_filters.erl
  2. +7 −2 src/sockjs_http.erl
View
2  src/sockjs_filters.erl
@@ -261,7 +261,7 @@ h_sid(Req, Headers, _Server, _SessionId) ->
%% session information is usually added by the load balancer.
case sockjs_http:jsessionid(Req) of
undefined -> [{"Set-Cookie", "JSESSIONID=dummy; path=/"}];
- _ -> []
+ Jsid -> [{"Set-Cookie", "JSESSIONID=" ++ Jsid ++ "; path=/"}]
end ++ Headers.
h_no_cache(_Req, Headers, _Server, _SessionId) ->
View
9 src/sockjs_http.erl
@@ -40,9 +40,14 @@ body_qs2({misultin, Req} = R) -> {proplists:get_value("d", Req:parse_post()), R}
%% TODO fix Req mutation for these two
jsessionid({cowboy, Req}) ->
{C, _} = cowboy_http_req:cookie(<<"JSESSIONID">>, Req),
- C;
+ case C of
+ _ when is_binary(C) ->
+ binary_to_list(C);
+ undefined ->
+ undefined
+ end;
jsessionid({misultin, Req}) ->
- Req:get_cookie_value('JSESSIONID', Req:get_cookies()).
+ Req:get_cookie_value("JSESSIONID", Req:get_cookies()).
callback({cowboy, Req}) ->
{CB, Req1} = cowboy_http_req:qs_val(<<"c">>, Req),
Please sign in to comment.
Something went wrong with that request. Please try again.