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