]> granicus.if.org Git - ejabberd/commitdiff
Returns unauthorized error when we do not have correct credentials
authorMickael Remond <mremond@process-one.net>
Wed, 30 Mar 2016 12:49:19 +0000 (14:49 +0200)
committerMickael Remond <mremond@process-one.net>
Wed, 30 Mar 2016 12:49:19 +0000 (14:49 +0200)
src/mod_http_api.erl
test/mod_http_api_test.exs

index 96fa907352bda163f81f2fe2f2f4c4ab39c79b1e..bbd4a28de635971b3f8b13682ecb0bf9d210ebcc 100644 (file)
@@ -183,7 +183,9 @@ check_permissions2(#request{ip={IP, _Port}}, Call, _Policy) ->
             end;
         _ ->
             unauthorized_response()
-    end.
+    end;
+check_permissions2(_Request, _Call, _Policy) ->
+    unauthorized_response().
 
 oauth_check_token(Scope, Token) when is_atom(Scope) ->
     oauth_check_token(atom_to_binary(Scope, utf8), Token);
index 11aad0689bb40ab50676bdf2677b853fc74cf468..adcb47061f7d4930c92ffae4289d4129823f412e 100644 (file)
@@ -43,7 +43,6 @@ defmodule ModHttpApiTest do
     {200, _, _} = :mod_http_api.process(["open_cmd"], request)
   end
 
-  @tag pending: true
   test "Call to user, admin, restricted commands without authentication are rejected" do
     request = request(method: :POST, data: "[]")
     {401, _, _} = :mod_http_api.process(["user_cmd"], request)