mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 19:29:11 +00:00
Fix specs.
This commit is contained in:
parent
1077c5c58d
commit
97257c692c
3 changed files with 3 additions and 3 deletions
|
@ -34,7 +34,7 @@ defmodule Pleroma.Web.Websub.WebsubController do
|
||||||
|
|
||||||
def websub_incoming(conn, %{"id" => id}) do
|
def websub_incoming(conn, %{"id" => id}) do
|
||||||
with "sha1=" <> signature <- hd(get_req_header(conn, "x-hub-signature")),
|
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),
|
%WebsubClientSubscription{} = websub <- Repo.get(WebsubClientSubscription, id),
|
||||||
{:ok, body, _conn} = read_body(conn),
|
{:ok, body, _conn} = read_body(conn),
|
||||||
^signature <- Websub.sign(websub.secret, body) do
|
^signature <- Websub.sign(websub.secret, body) do
|
||||||
|
|
|
@ -13,7 +13,7 @@ defmodule Pleroma.UserTest do
|
||||||
|
|
||||||
user = UserBuilder.build
|
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)
|
assert expected_ap_id == User.ap_id(user)
|
||||||
end
|
end
|
||||||
|
|
|
@ -170,7 +170,7 @@ defmodule Pleroma.Web.WebsubTest do
|
||||||
|
|
||||||
test "sign a text" do
|
test "sign a text" do
|
||||||
signed = Websub.sign("secret", "text")
|
signed = Websub.sign("secret", "text")
|
||||||
assert signed == "B8392C23690CCF871F37EC270BE1582DEC57A503"
|
assert signed == "B8392C23690CCF871F37EC270BE1582DEC57A503" |> String.downcase
|
||||||
|
|
||||||
signed = Websub.sign("secret", [["て"], ['す']])
|
signed = Websub.sign("secret", [["て"], ['す']])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue