From 8556588356704aad17fdafd9117ca107491721e2 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 7 Nov 2018 18:16:57 +0100 Subject: [PATCH] Fix issue with host header parsing Signed-off-by: Thomas Citharel --- lib/service/http_signatures/http_signatures.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/service/http_signatures/http_signatures.ex b/lib/service/http_signatures/http_signatures.ex index 737b6e584..efb688bdf 100644 --- a/lib/service/http_signatures/http_signatures.ex +++ b/lib/service/http_signatures/http_signatures.ex @@ -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)