QueueCommands: workaround for buggy clients that send "add /"
This commit is contained in:
parent
7c6b991de7
commit
460cfba6ff
2
NEWS
2
NEWS
@ -1,4 +1,6 @@
|
|||||||
ver 0.19.4 (not yet released)
|
ver 0.19.4 (not yet released)
|
||||||
|
* protocol
|
||||||
|
- workaround for buggy clients that send "add /"
|
||||||
* decoder
|
* decoder
|
||||||
- opus: add MIME types audio/ogg and application/ogg
|
- opus: add MIME types audio/ogg and application/ogg
|
||||||
|
|
||||||
|
@ -61,7 +61,16 @@ translate_uri(Client &client, const char *uri)
|
|||||||
CommandResult
|
CommandResult
|
||||||
handle_add(Client &client, gcc_unused unsigned argc, char *argv[])
|
handle_add(Client &client, gcc_unused unsigned argc, char *argv[])
|
||||||
{
|
{
|
||||||
const char *const uri = translate_uri(client, argv[1]);
|
const char *uri = argv[1];
|
||||||
|
if (memcmp(uri, "/", 2) == 0)
|
||||||
|
/* this URI is malformed, but some clients are buggy
|
||||||
|
and use "add /" to add the whole database, which
|
||||||
|
was never intended to work, but once did; in order
|
||||||
|
to retain backwards compatibility, work around this
|
||||||
|
here */
|
||||||
|
uri = "";
|
||||||
|
|
||||||
|
uri = translate_uri(client, uri);
|
||||||
if (uri == nullptr)
|
if (uri == nullptr)
|
||||||
return CommandResult::ERROR;
|
return CommandResult::ERROR;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user