Skip to content

Plug.Static should not raise error when an invalid path is received #642

@waj

Description

@waj

I understand that Plug.Static validates the path received to avoid directory traversals outside the specified directory. However I think it would be enough to discard the request and let other plugs to evaluate if they want to handle it.

For example, I have a Phoenix app where a controller receives one of the parameters that includes a slash (yes, my entity id contains slashes...). These slashes are properly escaped into the URL but the Plug.Static prevents these routes to reach the Phoenix router because it raises the InvalidPathError exception.

If there is not a better reason to continue raising this error, I could send a PR with the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions