Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/plug/adapters/test/conn.ex
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ defmodule Plug.Adapters.Test.Conn do
defp split_path(nil), do: []

defp split_path(path) do
segments = :binary.split(path, "/", [:global])
for segment <- segments, segment != "", do: segment
:binary.split(path, "/", [:global, :trim_all])
end

@already_sent {:plug_conn, :sent}
Expand Down
3 changes: 1 addition & 2 deletions lib/plug/conn/adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ defmodule Plug.Conn.Adapter do
end

defp split_path(path) do
segments = :binary.split(path, "/", [:global])
for segment <- segments, segment != "", do: segment
:binary.split(path, "/", [:global, :trim_all])
end

@doc """
Expand Down
2 changes: 1 addition & 1 deletion lib/plug/router/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ defmodule Plug.Router.Utils do

"""
def split(bin) do
for segment <- String.split(bin, "/"), segment != "", do: segment
:binary.split(bin, "/", [:global, :trim_all])
end

@deprecated "Use Plug.forward/4 instead"
Expand Down