Fix issue with host header parsing

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2018-11-07 18:16:57 +01:00
parent 28336f1b53
commit 6b4860b217

View file

@ -73,7 +73,7 @@ defmodule Mobilizon.Service.HTTPSignatures do
def validate_conn(conn, public_key) do
headers = Enum.into(conn.req_headers, %{})
[host_without_port, _] = String.split(headers["host"], ":")
host_without_port = String.split(headers["host"], ":") |> hd
headers = Map.put(headers, "host", host_without_port)
signature = split_signature(headers["signature"])
validate(headers, signature, public_key)