Skip to content

Commit 82a3dbe

Browse files
authored
Optimize router host matching (#1312)
1 parent 746b312 commit 82a3dbe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/plug/router/utils.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ defmodule Plug.Router.Utils do
5555
def build_host_match(host) do
5656
cond do
5757
is_nil(host) -> quote do: _
58-
String.last(host) == "." -> quote do: unquote(host) <> _
58+
String.ends_with?(host, ".") -> quote do: unquote(host) <> _
5959
is_binary(host) -> host
6060
end
6161
end

0 commit comments

Comments
 (0)