Skip to content

Waitress fails to match unicode url_prefix #492

Description

@jkmnt

If url_prefix contains character outside of ascii, it fails to match request path.

The code at

if path.startswith(url_prefix_with_trailing_slash):

compares url_prefix with path as is. The path here is 'utf8-as-latin1' string, while url_prefix is just the unicode string as is.

I think url_prefix should be converted at init time, i.e.

adj.url_prefix = url_prefix.encode("utf-8").decode("iso-8859-1")

and then reported in SCRIPT_NAME in this converted format. If I understand WSGI spec correctly, SCRIPT_NAME encoding should be the same as the PATH_INFO.

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