Skip to content

Serve static discard files with a tilde(~) in them even if valid #1649

Description

@CaselIT

The StaticRoute disallows serving files with a tilde (~) in them, even if the file is valid, like default~module.js

This is caused by the _DISALLOWED_CHARS_PATTERN regexp that contains the ~ char

_DISALLOWED_CHARS_PATTERN = re.compile('[\x00-\x1f\x80-\x9f\ufffd~?<>:*|\'"]')

I cannot easily change the name of the file (since it is the output of the build command of an angular application).
I understand that the tilde can cause problems since it normally indicates the home of the user, but I think it falcon should accept its use if it refers to a valid file name.

As an alternative maybe the _DISALLOWED_CHARS_PATTERN could be made public, so that it's documented and an user can customize it if they so wishes

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions