Fix specs.
authorRoger Braun <roger@rogerbraun.net>
Wed, 3 May 2017 18:06:20 +0000 (20:06 +0200)
committerRoger Braun <roger@rogerbraun.net>
Wed, 3 May 2017 18:06:20 +0000 (20:06 +0200)
lib/pleroma/web/websub/websub_controller.ex
test/user_test.exs
test/web/websub/websub_test.exs

index e5ecf6523224913c28478447dbdb5413e4a2d883..e860ec9e5381c180dde61df581a892cba7a345d3 100644 (file)
@@ -34,7 +34,7 @@ defmodule Pleroma.Web.Websub.WebsubController do
 
   def websub_incoming(conn, %{"id" => id}) do
     with "sha1=" <> signature <- hd(get_req_header(conn, "x-hub-signature")),
-         signature <- String.upcase(signature),
+         signature <- String.downcase(signature),
          %WebsubClientSubscription{} = websub <- Repo.get(WebsubClientSubscription, id),
          {:ok, body, _conn} = read_body(conn),
          ^signature <- Websub.sign(websub.secret, body) do
index 7435e30e08464804ed7ecc6389cadfff5b987462..036e70dff3cfec9b29db568e4d860a0e925d99c5 100644 (file)
@@ -13,7 +13,7 @@ defmodule Pleroma.UserTest do
 
     user = UserBuilder.build
 
-    expected_ap_id = "https://#{host}/users/#{user.nickname}"
+    expected_ap_id = "#{Pleroma.Web.base_url}/users/#{user.nickname}"
 
     assert expected_ap_id == User.ap_id(user)
   end
index 065fb250aa8c9de3d2d5a88f6719c74439bf4cc7..48774dc692c28d3a2d63eae381a836b771c0e241 100644 (file)
@@ -170,7 +170,7 @@ defmodule Pleroma.Web.WebsubTest do
 
   test "sign a text" do
     signed = Websub.sign("secret", "text")
-    assert signed == "B8392C23690CCF871F37EC270BE1582DEC57A503"
+    assert signed == "B8392C23690CCF871F37EC270BE1582DEC57A503" |> String.downcase
 
     signed = Websub.sign("secret", [["て"], ['す']])
   end