1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-22 07:52:43 +00:00

test: fix ActivityPub headers test

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-11-15 17:30:35 +01:00
parent 8d11073965
commit f24866012b
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -34,7 +34,17 @@ defmodule Mobilizon.Federation.ActivityPubTest do
date: Signature.generate_date_header()
})
assert signature =~ "headers=\"date host digest content-length (request-target)\""
headers =
signature
|> String.split(",")
|> Enum.find(&String.starts_with?(&1, "headers"))
|> String.replace_prefix("headers=\"", "")
|> String.replace_suffix("\"", "")
|> String.split(" ")
|> MapSet.new()
assert headers ==
MapSet.new(["date", "host", "digest", "content-length", "(request-target)"])
end
end