Skip to content

Commit

Permalink
#37 - Method is binary in new cowboy
Browse files Browse the repository at this point in the history
Should be atom
  • Loading branch information
majek committed Dec 14, 2012
1 parent ea94f85 commit 0aca923
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sockjs_http.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ path({cowboy, Req}) -> {Path, Req1} = cowboy_http_req:raw_path(Req),

-spec method(req()) -> {atom(), req()}.
method({cowboy, Req}) -> {Method, Req1} = cowboy_http_req:method(Req),
{Method, {cowboy, Req1}}.
case is_binary(Method) of
true -> {binary_to_atom(Method, utf8), {cowboy, Req1}};
false -> {Method, {cowboy, Req1}}
end.

-spec body(req()) -> {binary(), req()}.
body({cowboy, Req}) -> {ok, Body, Req1} = cowboy_http_req:body(Req),
Expand Down

0 comments on commit 0aca923

Please sign in to comment.