Skip to content

Commit

Permalink
Fix missing function clause in sockjs_http:method_atom/1
Browse files Browse the repository at this point in the history
  • Loading branch information
blinkov authored and gebi committed May 13, 2013
1 parent 27aaa43 commit 0accaee
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/sockjs_http.erl
Expand Up @@ -16,13 +16,21 @@ path({cowboy, Req}) -> {Path, Req1} = cowboy_req:path(Req),
method({cowboy, Req}) -> {Method, Req1} = cowboy_req:method(Req),
{method_atom(Method), {cowboy, Req1}}.

-spec method_atom(binary()) -> atom().
-spec method_atom(binary() | atom()) -> atom().
method_atom(<<"GET">>) -> 'GET';
method_atom(<<"PUT">>) -> 'PUT';
method_atom(<<"POST">>) -> 'POST';
method_atom(<<"DELETE">>) -> 'DELETE';
method_atom(<<"OPTIONS">>) -> 'OPTIONS';
method_atom(<<"PATCH">>) -> 'PATCH'.
method_atom(<<"PATCH">>) -> 'PATCH';
method_atom(<<"HEAD">>) -> 'HEAD';
method_atom('GET') -> 'GET';
method_atom('PUT') -> 'PUT';
method_atom('POST') -> 'POST';
method_atom('DELETE') -> 'DELETE';
method_atom('OPTIONS') -> 'OPTIONS';
method_atom('PATCH') -> 'PATCH';
method_atom('HEAD') -> 'HEAD'.

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

0 comments on commit 0accaee

Please sign in to comment.