mschae / trailing_format_plug

An elixir plug to support legacy APIs that use a rails-like trailing format: http://api.dev/resources.json
25 stars 15 forks source link

Support root path ("/") #6

Closed mlarraz closed 7 years ago

mlarraz commented 8 years ago

Handles the conn.path_info = [] case

smpallen99 commented 7 years ago

I've solved this issue by simply adding and additional function clause

  def call(%{path_info: []} = conn, _opts), do: conn
  def call(conn, _opts) do
    ...
mlarraz commented 7 years ago

Very nice, that works quite well