From e789b9cdaafa8d63a6738af91061f20f65ee97e8 Mon Sep 17 00:00:00 2001 From: preciz Date: Mon, 15 Jun 2026 13:11:34 +0200 Subject: [PATCH] Optimize router host matching --- lib/plug/router/utils.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plug/router/utils.ex b/lib/plug/router/utils.ex index ae43f125..d7f6bb1f 100644 --- a/lib/plug/router/utils.ex +++ b/lib/plug/router/utils.ex @@ -55,7 +55,7 @@ defmodule Plug.Router.Utils do def build_host_match(host) do cond do is_nil(host) -> quote do: _ - String.last(host) == "." -> quote do: unquote(host) <> _ + String.ends_with?(host, ".") -> quote do: unquote(host) <> _ is_binary(host) -> host end end