Skip to content

Breaks non-existent routes with format extensions #10

@ecoslado

Description

@ecoslado

We are currently using trailing_format_plug for an API we are implementing with Phoenix. We use it to declare urls like example.com/:one_param, receive requests with example.com/one_value.js and use "one_value" in the action.

When favicon.ico is requested, a FunctionClauseError is raised (NotFound was expected). This is the error message:
(FunctionClauseError) no function clause matching in Plug.Conn.resp/3

I thought it could be fixed by adding an option :only to TrailingFormatPlug, just to list which formats you allow to be set by TrailingFormatPlug, but I'm new in Elixir-Phoenix ecosystem so I'd like to know if there's a better way...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions