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.
If
url_prefixcontains character outside of ascii, it fails to match requestpath.The code at
waitress/src/waitress/task.py
Line 527 in b590603
compares
url_prefixwith path as is. Thepathhere is 'utf8-as-latin1' string, whileurl_prefixis just the unicode string as is.I think
url_prefixshould be converted at init time, i.e.and then reported in
SCRIPT_NAMEin this converted format. If I understand WSGI spec correctly,SCRIPT_NAMEencoding should be the same as thePATH_INFO.