mirror of
https://github.com/beetbox/beets.git
synced 2025-12-23 17:13:30 +01:00
web plugin: support path queries by separating them with a backslash
Without this change the web plugin does not support path queries as slashes are currently used for joining keywords in the QueryConverter. Moreover, flask cannot distinguish between an URL encoded and a plain '/' character during routing [0]. To work around this issue without introducing a breaking change (i.e. removing the QueryConverter) use the backslash character for path queries and convert it later on. Fixes #3566 [0]: https://github.com/pallets/flask/issues/900
This commit is contained in:
parent
47deb2f084
commit
6a03afc65d
1 changed files with 3 additions and 2 deletions
|
|
@ -177,10 +177,11 @@ class QueryConverter(PathConverter):
|
|||
"""
|
||||
|
||||
def to_python(self, value):
|
||||
return value.split('/')
|
||||
queries = value.split('/')
|
||||
return [query.replace('\\', os.sep) for query in queries]
|
||||
|
||||
def to_url(self, value):
|
||||
return ','.join(value)
|
||||
return ','.join([v.replace(os.sep, '\\') for v in value])
|
||||
|
||||
|
||||
class EverythingConverter(PathConverter):
|
||||
|
|
|
|||
Loading…
Reference in a new issue